spencermountain / spacetime

A lightweight javascript timezone library
http://spacetime.how/
Other
3.97k stars 185 forks source link

Running "npm test" does not work in windows #354

Closed chintan-golakiya closed 1 year ago

chintan-golakiya commented 1 year ago

while running npm test on windows, it doesn't work. Here is this error:

$ npm test     

> spacetime@7.2.0 test
> TESTENV=dev tape ./test/**/*.test.js | tap-dancer  --color always

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

Removing TESTENV=dev from package.json solves issue for me. To solve this issue for all I think one of following approach can help. 1) Remove TESTENV=dev from package.json as this does not work in all OS and setting environment variable in .env could be mentioned in contributing.md file 2) Remove TESTENV=dev from package.json as this does not work in all OS and setting environment variable using process.env.TESTENV='dev'; in all *.test.js files.

please share which could be good solution, I would like contribute in required changes for this.

spencermountain commented 1 year ago

hey good catch Chintan, thanks for the heads up. You're right - the only thing TESTENV is used for is the npm run testb command, which runs the tests with the builds file. That is important to catch anything breaking in the build somehow. The current setup could use some work, and I'd welcome alternative ways to do this.

yeah - as long as npm run test runs ./src and npm run testb runs ./builds - and I don't have to think about it, any solution you prefer sounds good to me. cheers

spencermountain commented 1 year ago

added to 7.3.0 thanks