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

[Added]: crossenv for jest script #2732

Closed

Conversation

anikethsaha
Copy link
Contributor

The present script

"jest": "NODE_ENV=test jest \"$@\"",

Present Error

Will throw a system error in windows displaying

'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.


fix
To fix this we can have seperate jest script based on platform

The new script

 "jest:win32": "SET NODE_ENV=test && jest \"$@\"",

The above script will work fine with windows and OSX. And the jest for
linux

Present script will throw a system error in windows displaying

```
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
```

fix
To fix this we can have seperate jest script based on platform

The new script

 `"jest:win32": "SET NODE_ENV=test && jest \"$@\"", `
@sibelius
Copy link
Contributor

can you use crossenv instead https://github.com/kentcdodds/cross-env?

@anikethsaha
Copy link
Contributor Author

anikethsaha commented May 12, 2019

Yeah..it can be done, then have to add it as a dependency here. Is it fine then ?
should I add it then ? @sibelius

@sibelius
Copy link
Contributor

let's go with crossenv

@anikethsaha
Copy link
Contributor Author

okay

Added cross-env package as dependency to run the jest script in cross
other OS without crash .
@anikethsaha
Copy link
Contributor Author

cc @sibelius

@anikethsaha anikethsaha changed the title [Added]: new jest script for windows : jest:win32 [Added]: crossenv for jest script May 13, 2019
@anikethsaha
Copy link
Contributor Author

@jstejada PTAL //

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@kassens is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@kassens
Copy link
Member

kassens commented Jun 6, 2019

Thanks!

@anikethsaha
Copy link
Contributor Author

@kassens Should I rebase ?

@kassens
Copy link
Member

kassens commented Jun 6, 2019

No need, it merged cleanly :)

@anikethsaha
Copy link
Contributor Author

Great 👍

@facebook-github-bot
Copy link
Contributor

@kassens merged this pull request in 720570f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants