Skip to content

Don't crash npm test when hg/git are missing#5212

Merged
gaearon merged 1 commit intomasterfrom
test-git
Oct 1, 2018
Merged

Don't crash npm test when hg/git are missing#5212
gaearon merged 1 commit intomasterfrom
test-git

Conversation

@gaearon
Copy link
Copy Markdown
Contributor

@gaearon gaearon commented Oct 1, 2018

Fixes #5210 with a clunky workaround.
I hope this more or less matches the Jest logic.

// @remove-on-eject-end

const jest = require('jest');
const execSync = require('child_process').execSync;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this use react-dev-utils/crossSpawn?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I dunno. I copy pasted from init.js. That's what we use there. Should I worry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We also use it in CRA itself for detecting yarn. I think it's fine.

@SimenB
Copy link
Copy Markdown
Contributor

SimenB commented Oct 1, 2018

I hope this more or less matches the Jest logic.

Jest uses jest-changed-files, but that's probably overkill in your case. IMO the approach you take here is fine

@gaearon gaearon merged commit b103376 into master Oct 1, 2018
Copy link
Copy Markdown
Contributor

@rogeliog rogeliog left a comment

Choose a reason for hiding this comment

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

@Timer Timer deleted the test-git branch October 1, 2018 22:06
zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Oct 29, 2018
@lock lock Bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants