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

Split index.js into separate files #500

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

brandon93s
Copy link
Contributor

@brandon93s brandon93s commented Jul 6, 2018

Splits the got codebase into its sub-components.

const mimicResponse = () => {
throw new Error('Error in mimic-response');
};
mimicResponse['@global'] = true;
Copy link
Contributor Author

@brandon93s brandon93s Jul 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not best practice to use @global with proxyquire but it does not currently result in any side-effects in the tests. An alternative would be to introduce a mimic-response-wrapper.js that exports a named function we can stub with Sinon and then use that in got.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, I think what you have here is fine.

@sindresorhus sindresorhus changed the title Split got into separate files Split index.js into separate files Jul 6, 2018
@sindresorhus sindresorhus merged commit b54b680 into sindresorhus:master Jul 6, 2018
@sindresorhus
Copy link
Owner

Really good! 🙌

@alextes
Copy link
Contributor

alextes commented Jul 11, 2018

@brandon93s some part of me had been wanting to do this PR for soooo long haha.
I'm a tiny bit jealous and mostly very thankful you made a long time wish of mine come true 👏 😄 !

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.

None yet

3 participants