-
Notifications
You must be signed in to change notification settings - Fork 238
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
Replace gulp/mocha/mockery/istanbul with Jest #187
Conversation
… and add a yarn lock file.
Why Jest? I would be happy to do a PR for AVA. It would let us use async/await which simplifies the tests. Example: https://github.com/sindresorhus/generator-nm/blob/master/test.js |
Hej Sindre, Simon said:
See yeoman/generator-node#222 and yeoman/generator-node#251 for additional context. Cheers, Michael |
It's not really much context though. All I see is something like "We have two good candidates" and then it was done. And how is that even relevant to this generator? |
@sindresorhus I chose Jest mainly because it's the one I used a fair amount - because it became the de-facto react test runner. Also, the api is almost a 1-1 with mocha, so I felt it was a fairly easy upgrade for current users of generator-node/generator-generator. And there's 0 config to get code coverage; which was the main motivation to move away from Mocha. Not saying it's necessarily better than ava, but it worked well for my use-cases and I knew the tool. |
__tests__/app.js
Outdated
|
||
mockery.registerMock('superb', () => { | ||
beforeEach(() => { | ||
jest.mock('superb', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want jest.mock('superb', () => () => 'cat\'s meow');
Having the same test setup makes it easy to update generator-generator with running See #186 (comment) |
@SBoudrias Thanks. Are we ready to squash and merge to get generator-generator 3.0.0 out on the streets? |
Let's get the eslintignore before releasing v3 |
Hey @mischah I meant the .eslintignore should also be generated for generator-generator users, as they'll run into the same issue. |
Oops. Makes sense. But shouldn't this be provided by generator-node? @SBoudrias |
No because the template directory is only related to yeoman-generators |
Sorry for the confusion. I’m going to tackle this tonight. |
No need to use this since we have a .eslintignore. Seems to sllipped trough #187
… and add a yarn lock file.
@SBoudrias I need your help 😣
Can’t get those damn tests green.
Reason: I really don’t understand the mocking part.
I checked how you update the tests in generator-node and read the Jest docs but can’t get my head around.
Could you please have a look?