Closed OskarKlintrot closed 7 years ago
I believe the npm run test-all
command runs npm run test-e2e-bg
which is intended for linux. @webteckie what's the correct way to run this on windows? should we be using cross-env rather than export here?
@webteckie the error output complain about the export shell command in the test-e2e-bg command from the package.json
@bassjacob If you look at the PowerShell output, the error is to do with the Mocha tests not the e2e tests :)
@jstockwin, I don't think so. All the unit tests pass (the printout during the unit test run is console.error output from a model validator).
Line 53 of the output from powershell shows the actual failure:
> keystone@4.0.0-beta.5 test-e2e-bg C:\_repos\keystone
> export KNE_SELENIUM_START_PROCESS=false && node test/e2e/server.js --env default
'export' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test-e2e-bg"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! keystone@4.0.0-beta.5 test-e2e-bg: `export KNE_SELENIUM_START_PROCESS=false && node test/e2e/server.js --env default`
npm ERR! Exit status 1
Ah yeah okay my bad. export
works on my (Windows 10) machine... strange. Maybe it's PowerShell.
Running npm test-e2e
should work, as it won't export anything. As a fix, cross-env looks good to me.
@jstockwin works ok for you running in powershell? or in git-bash or cygwin or another *nix emulator shell?
@bassjacob Huh, no it doesn't work in PowerShell OR git bash. I guess I've always just run npm run test-e2e
...
huh, weird. definitely worth us taking a look if we want people to run it in order to submit a PR.
@bassjacob cross-env worked nicely for me. See #3947
I still get the Mongoose model 'error' event fired on 'DependsOn' with error
-error with the fix from your PR. Otherwise it works just fine.
that's ok, it's not an error :smile: there's a couple of tests that assert that mongo will not save an invalid model. since we don't supress output from a console.error call, mongoose prints a "failure" to the terminal, which is exactly what the test expects.
I just couldn't understand how all tests could be passing when I clearly could see an error in the log 💡
Steps to reproduce the behavior
On Windows 10 PS:
Add
"linebreak-style": 0
to.eslintrc
Expected behavior
Tests passing
Actual behavior
Tests not passing.
output from PowerShell npm-debug.log