Cannot resolve path in Mocha

前端 未结 7 1284
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 21:45

I am currently using Nitrous, which shouldn\'t matter, but I needed to install mocha so I typed in:

npm install - g mocha.

Everything insta

7条回答
  •  梦毁少年i
    2020-12-30 22:38

    For those having mocha installed and have makefile like this:

    test:
        @./node_modules/.bin/mocha -u tdd
    .PHONY: test
    

    but getting this error:

    Error: cannot resolve path (or pattern) 'test'
    

    you need to add folder "test" in the project folder. And your test files in that test folder

    E.G.
     /home/you/nodejs/chapter3
      ├── lib
      ├── makefile
      ├── node_modules
      ├── package.json
      └── test
           ├── db.test.js

提交回复
热议问题