-
Notifications
You must be signed in to change notification settings - Fork 453
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
Removed requires #248
Removed requires #248
Conversation
|
||
beforeEach(() => { | ||
jest.resetModules(); | ||
yargsMock = jest.fn(); | ||
jest.setMock('yargs', yargsMock); | ||
getJestConfig = require('../../src/utils').getJestConfig; |
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.
Does getJestConfig
have an internal state that requires it to be require
d cleanly on each run (thus the beforeEach
)?
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.
It does not. I don't even think multiple requires do anything state-wise. Simply an oversight.
Just one question above. It looks like travis is having some trouble pulling in dependencies but other than that this LGTM as long as the answer to the above question is "no". |
const setFromArgv = require('jest-config/build/setFromArgv'); | ||
// import * as setFromArgv from 'jest-config/build/setfromArgv'; |
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.
setFromArgv
is a default export. Could that be causing the build to fail?
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.
Strange I seem to have tried importing it in es6 as a default import as well, but I didn't get it to work. Leaving it as a require is fine for me.
Allows for better static analysis. I didn't remove all the requires, only the ones easily translatable into es6 modules.
Resolves #225