Comments (9)
I've set test
to ./node_modules/.bin/nyc.cmd ./node_modules/.bin/mocha.cmd
It's now outputting:
> [email protected] test C:\perso\sails-hook-annotation-router
> nyc.cmd ./node_modules/.bin/mocha.cmd
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Test failed. See above for more details.
I've tested the same on linux, it does work.
Unfortunately I need to stick with windows for my job. :/
from nyc.
CC: @isaacs seems like our shebang logic is having trouble with Windows.
You might try explicitly specifying the path to the mocha bin:
./node_modules/.bin/nyc ./node_modules/.bin/mocha test
from nyc.
Interesting!
I'm not super surprised that it doesn't work on Windows. There's some deep and strange unixy stuff going on. But I wonder where the error actually lies.
I'll try to spin up a VM soon. Either spawn-wrap is just busted on Windows (my guess), or it's something specific to do with how nyc is invoking it.
from nyc.
I'm getting a failure on my Windows CI machines that might be related to this. The stack trace might be slightly more useful than the above:
child_process.js:1162
throw errnoException(err, 'spawn');
^
Error: spawn UNKNOWN
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1162:11)
at ChildProcess.spawn (D:\workspace\strongloop-license.pr\412f199f\node_modules\tap\node_modules\nyc\node_modules\spawn-wrap\index.js:143:18)
at exports.spawn (child_process.js:995:9)
at module.exports (D:\workspace\strongloop-license.pr\412f199f\node_modules\tap\node_modules\foreground-child\index.js:12:15)
at Object.<anonymous> (D:\workspace\strongloop-license.pr\412f199f\node_modules\tap\node_modules\nyc\bin\nyc.js:54:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
That is the result of running tap --bail --save fails.txt --coverage test/test-*.js
in a subshell that has $(pwd)/node_modules/.bin
injected into the PATH
.
from nyc.
@rmg @mastilver I don't currently have a Windows testing environment, but I will try to get one up and running soon. It would be nice to try to get things at least partially working with Windows.
from nyc.
For me, nyc npm test
still fails on Windows, but now, I get a different error.
I suspect it's because the argv
variable is wrong, but I'm not sure...
Update
Even if I don't use npm
, it still fails.
from nyc.
@motapc97 :-(
What about nyc ./test/mota-test.js
or nyc ./node_modules/.bin/grunt buildTest
?
from nyc.
As you can see, the first command doesn't fail, but I find no coverage output :(
from nyc.
Sorry, but I keep getting errors...
from nyc.
Related Issues (20)
- Jest and Cypress's coverage merged results is wrong
- nyc should use nodejs module customization hooks rather than monkey patching
- Node v20: TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('128SIGINT') HOT 5
- Is there any way to extract/remove Babel from NYC?
- How to use nyc with TypeScript and ESM? HOT 1
- fix: merging two coverage reports for same source file causes crash HOT 1
- NYC checkCoverage doesn't have a way to throw error when insufficient coverage met
- nyc test coverage on branches is not accurate - Seems to be happening with nyc@v15, [email protected] and [email protected] HOT 6
- Code coverage is not instrumenting React components (React Native)
- Code rewriting breaks function name inferencing HOT 1
- nyc not working with project type module (esm) HOT 1
- nyc ignores files ending with `-test.ts`
- Unable to get coverage for files executed via runInThisContext HOT 1
- Markdown reporter HOT 1
- Is there a way to filter files in the stage `nyc report` ?
- Merging with nyc storybook test coverage with other reports generated by coverageProvider 'istanbul' result in wrong coverage HOT 2
- Issue with Instrumentation of Code Coverage for my Angular V17 Project
- is it possible to store nyc output with relative path?
- cccccbgvrekrbvdtukvnhiffetjntbbuuijkfblietjr
- Use of deprecated glob and rimraf dependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nyc.