Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize mocha tests #112

Closed
amilajack opened this issue Aug 1, 2016 · 21 comments
Closed

Parallelize mocha tests #112

amilajack opened this issue Aug 1, 2016 · 21 comments

Comments

@amilajack
Copy link
Owner

No description provided.

@amilajack
Copy link
Owner Author

@thangngoc89
Copy link
Contributor

I usually use AVA. It was built with parralism and es6 in mind

@amilajack
Copy link
Owner Author

Initially, this project was using Ava but I had to switch to mocha because I couldn't get chaijs to work with mocha

@amilajack
Copy link
Owner Author

I also like the cleaner output of mocha.

@amilajack
Copy link
Owner Author

But if we can get these things with Ava, lets migrate to it.

@thangngoc89
Copy link
Contributor

Ok. That's cool. Can you be more specific sbot what you can't do with ava?

@amilajack
Copy link
Owner Author

amilajack commented Aug 1, 2016

It's helpful to have the tests output in an ordered 'list', like they do in mocha.

@amilajack amilajack added this to the Release 0.0.5 milestone Aug 6, 2016
@amilajack amilajack changed the title Parallelize mocha test Parallelize mocha tests Aug 24, 2016
@thangngoc89
Copy link
Contributor

I played around with Jest for a few day. So far so good, it uses expect as it assert library so no change on tests file. And with Jest 14, they released a killer feature: Snapshot testing with React

http://facebook.github.io/jest/blog/2016/07/27/jest-14.html

I suggest you give it a try

@amilajack
Copy link
Owner Author

This should be a planned feature but at the moment i dont think its very urgent. When this project is stable i think we should migrate add screenshot tests to all the component tests.

@thangngoc89
Copy link
Contributor

we should migrate add screenshot tests to all the component tests.

Agreed. Visual testing is slow and error prone.

I forgot to mention, Jest can run test in parallel by default

@amilajack amilajack removed this from the Release 0.0.5 milestone Sep 6, 2016
@onbjerg
Copy link

onbjerg commented Oct 16, 2016

@amilajack You can get mocha-like output from ava. Remember that ava is TAP-compatible, so you can use any TAP reporter.

This was probably the one you were looking for.

@amilajack
Copy link
Owner Author

@onbjerg Can I have nested tests like this:

describe('Some', () => {
  describe('Another', () => {
    it('should test Foo', () => {
      // Some test here
    })
  })
})

@onbjerg
Copy link

onbjerg commented Oct 16, 2016

Not really. I agree with sindre that it is sort of an anti-pattern and should be discouraged. The most you can do is:

import test from 'ava'

test('something', (t) => {
  t.is(1, 1, '1 is 1')
})

Regardless, the thing you're asking was/is being discussed in avajs/ava#222.

@amilajack
Copy link
Owner Author

Can chai be used with ava?

@onbjerg
Copy link

onbjerg commented Oct 16, 2016

Actually, scratch that. There's a package for that(tm): https://github.com/sheerun/ava-spec.

Can chai be used with ava?

Yes. But you might want to read a bit more about it here, as there are some trade-offs: Custom assertions.

Also, read avajs/ava#25 (which is linked in that section of the README), since the trade off might not be a deal-breaker overall.

@amilajack
Copy link
Owner Author

amilajack commented Oct 16, 2016

I see. All our tests are already written in mocha. It would be worth he migration to ava if it supported running tests on multiple threads. At the moment tho there are a bunch of architectural concerns with the project that need attention right now. Are you interested in contributing? 😁

@onbjerg
Copy link

onbjerg commented Oct 16, 2016

It runs tests in parallel per default.

I might be up for contributing 🍇

@amilajack
Copy link
Owner Author

Yesss! 🔥🎉😁

What areas are you experienced in? Node? React? Redux? etc

@onbjerg
Copy link

onbjerg commented Oct 16, 2016

Been doing Node for a few years, been doing React/Redux for a year or so 😬 I'm experienced in a lot of other things, too, but I don't think they apply to this project.

@amilajack
Copy link
Owner Author

That's great! Also I invited you to the gitter. I just commented an introduction to the project. Would recommend checking that out.

@amilajack
Copy link
Owner Author

@onbjerg just looked into jest and it looks very promising. What do you think about PR'ing for this? 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants