簡體   English   中英

業力測試通過但npm測試給出錯誤

[英]karma test pass but npm test give error

我使用https://github.com/AngularClass/angular2-webpack-starter並遇到以下問題:當我在項目目錄中並運行時

karma start

然后我得到:

摘要:

✔0個測試完成

但是當我跑步時:

npm test

我得到:

摘要:

✔0個測試完成

npm ERR! 測試失敗。 有關更多詳細信息,請參見上文。

如果我運行:

npm run test

我得到:

SUMMARY:
✔ 0 tests completed

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node/7.1.0/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v7.1.0
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! angular2-webpack-starter@5.0.5 test: `karma start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular2-webpack-starter@5.0.5 test script 'karma start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     karma start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular2-webpack-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Kamil/Desktop/Code/officewise/officewise_frontend/npm-debug.log

知道該怎么做才能刪除此npm ERR嗎? 這對我很重要,因為我使用一些外部系統來運行測試並報告存儲庫中新提交的錯誤(我的節點版本v7.1.0(最新),npm版本4.0.2(最新),Mac OS Sierra)。

默認情況下,如果沒有要運行的測試,則Karma退出並顯示錯誤。

要禁用此行為,您需要將此行添加到您的Karma配置中:

failOnEmptyTestSuite: false

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM