Giter Club home page Giter Club logo

Comments (9)

mastilver avatar mastilver commented on June 6, 2024 2

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.

bcoe avatar bcoe commented on June 6, 2024

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.

isaacs avatar isaacs commented on June 6, 2024

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.

rmg avatar rmg commented on June 6, 2024

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.

bcoe avatar bcoe commented on June 6, 2024

@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.

 avatar commented on June 6, 2024

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.

rmg avatar rmg commented on June 6, 2024

@motapc97 :-(

What about nyc ./test/mota-test.js or nyc ./node_modules/.bin/grunt buildTest?

from nyc.

 avatar commented on June 6, 2024

As you can see, the first command doesn't fail, but I find no coverage output :(

from nyc.

 avatar commented on June 6, 2024

Sorry, but I keep getting errors...

from nyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.