brave / browser-laptop

[DEPRECATED] Please see https://github.com/brave/brave-browser for the current version of Brave
https://www.brave.com
Other
7.95k stars 974 forks source link

running tests on windows fail #2719

Closed david-gang closed 7 years ago

david-gang commented 8 years ago

Did you search for similar issues before submitting this one? Yes Describe the issue you encountered:

When running tests on windows i get the message "J:\webstorm\WebStorm 2016.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" test

brave@0.11.1 test J:\webstorm_workspace\browser-laptop NODE_ENV=test mocha --compilers js:babel-register --recursive $(find test -name '*Test.js')

'NODE_ENV' is not recognized as an internal or external command, operable program or batch file. npm ERR! Test failed. See above for more details.

Process finished with exit code 1

Expected behavior:

The problem is described at http://stackoverflow.com/questions/11928013/node-env-is-not-recognized-as-an-internal-or-external-command-operable-comman

In git bash the command works.

bsclifton commented 8 years ago

This is definitely a known issue and as a Windows user, it's been bugging me for a long time.

w/ GitHub shell, it fails like you have above. You can doctor the command into two commands: set NODE_ENV=test mocha --compilers js:babel-register --recursive $(find test -name '*Test.js'

This will work and tests will start running. The unit tests will work fine, there are problems at the moment w/ Spectron tests on Windows (the ones which pop up the window and use web driver to test).

What would be great would be to replace the npm test commands with a node.js script that we can use instead (which is multi-OS friendly).

bsclifton commented 8 years ago

Work is in progress here: https://github.com/brave/browser-laptop/tree/windows-tests

bsclifton commented 7 years ago

I believe this is resolved now! (huge thanks to @bbondy, who knocked this out). There are some errors still, but it's mostly working 😄