dimanche 7 février 2016

node js module not found for directory of tape tests

I have the following structure:

src/examples/test_file.js
src/test/example.test.js

package.json:

  "scripts": {
    "test": "node ./test/*.test.js"
  },

I have tape installed via npm install tape --save

I run npm test and i get:

> node ./test/*.test.js

module.js:328
    throw err;
    ^

Error: Cannot find module 'c:\src\test\*.test.js'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)
    at node.js:1003:3
npm ERR! Test failed.  See above for more details.

Per this: http://ift.tt/1lJkRAW

tests on a whole dir should only work with a global install of a node package. How can i get the above to work without globally installing tape?

I am using node 5.4 and windows 10

Aucun commentaire:

Enregistrer un commentaire