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

Removed requires #248

Merged
merged 2 commits into from
Jun 15, 2017
Merged

Removed requires #248

merged 2 commits into from
Jun 15, 2017

Conversation

GeeWee
Copy link
Collaborator

@GeeWee GeeWee commented Jun 14, 2017

Allows for better static analysis. I didn't remove all the requires, only the ones easily translatable into es6 modules.

Resolves #225


beforeEach(() => {
jest.resetModules();
yargsMock = jest.fn();
jest.setMock('yargs', yargsMock);
getJestConfig = require('../../src/utils').getJestConfig;
Copy link
Contributor

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 required cleanly on each run (thus the beforeEach)?

Copy link
Collaborator Author

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.

@bcruddy
Copy link
Contributor

bcruddy commented Jun 15, 2017

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';
Copy link
Owner

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?

Copy link
Collaborator Author

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.

@kulshekhar kulshekhar merged commit e28afd9 into master Jun 15, 2017
@kulshekhar kulshekhar deleted the code-cleanup branch July 4, 2017 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants