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

Cannot run lesson-2 tests #9

Open
MrSamsa42 opened this issue Nov 3, 2019 · 2 comments
Open

Cannot run lesson-2 tests #9

MrSamsa42 opened this issue Nov 3, 2019 · 2 comments

Comments

@MrSamsa42
Copy link

I am not able to run the tests associated with lesson 2. See terminal output below. Environment is Windows 10, Node 12.10

npm run test-schema

[email protected] test-schema C:\Users\mrsam\Projects\Education\intro-to-graphql
GQL_LESSON=lesson-2 npm test -- -t lesson-2

'GQL_LESSON' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test-schema: GQL_LESSON=lesson-2 npm test -- -t lesson-2
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-schema script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mrsam\AppData\Roaming\npm-cache_logs\2019-11-03T21_38_39_591Z-debug.log

@MrSamsa42
Copy link
Author

It took forever, but I found the solution. Stack Overflow to the rescue (again): https://stackoverflow.com/questions/9249830/how-can-i-set-node-env-production-on-windows

So, change the script in the package.json file to:
"test-schema": "set GQL_LESSON=lesson-2 && npm test -- -t lesson-2"

@peerhenry
Copy link

It should be:
"test-schema": "cross-env GQL_LESSON=lesson-2 npm test -- -t lesson-2"

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

No branches or pull requests

2 participants