相关疑难解决方法(0)

运行测试时npm错误ELIFECYCLE

我正在使用mocha-phantomjs设置进行单元测试.我有以下package.json scriot来运行测试.

"scripts": {
"test": "npm run testFlickr",
"testFlickr": "mocha-phantomjs ./test/FlickrTest.html" 
}
Run Code Online (Sandbox Code Playgroud)

这在浏览器中运行正常.当我npm test在cmd中运行命令时,测试运行正常,但它也会出现以下错误

3 passing (5s)
6 failing


npm ERR! flickr-test@ testFlickr: `mocha-phantomjs ./test/FlickrTest.html`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the flickr-test@ testFlickr script.
npm ERR! This is most likely a problem with the flickr-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha-phantomjs ./test/FlickrTest.html
npm ERR! You can get …
Run Code Online (Sandbox Code Playgroud)

unit-testing node.js npm mocha-phantomjs

15
推荐指数
4
解决办法
2万
查看次数

标签 统计

mocha-phantomjs ×1

node.js ×1

npm ×1

unit-testing ×1