我正在运行一个相当复杂的前端堆栈。我在 ES6 中使用 node、gulp、webpack 和 angular 1.5。
我使用 yo 喷泉发生器设置我的项目。
我写了一些测试(失败了),但注意到我遇到了另一个意外失败 - 所以我删除了所有测试。Karma 再次给了我一个失败(尽管没有运行测试),我不知道为什么。
看起来它可能会在内部引发异常并将其解释为失败的测试,但我对 Karma 的了解还不够,无法真正了解。
下面是运行 gulp 测试的完整打印输出。任何人都知道会导致这种情况。
[21:38:56] Loading /Users/samredway/Development/crunchboards/cb-admin-panel/frontend/gulp_tasks/browsersync.js
[21:38:56] Loading /Users/samredway/Development/crunchboards/cb-admin-panel/frontend/gulp_tasks/karma.js
[21:38:56] Loading /Users/samredway/Development/crunchboards/cb-admin-panel/frontend/gulp_tasks/misc.js
[21:38:56] Loading /Users/samredway/Development/crunchboards/cb-admin-panel/frontend/gulp_tasks/webpack.js
[21:38:57] Using gulpfile ~/Development/crunchboards/cb-admin-panel/frontend/gulpfile.js
[21:38:57] Starting 'test'...
[21:38:57] Starting 'karma:single-run'...
13 10 2016 21:39:01.686:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
13 10 2016 21:39:01.688:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
13 10 2016 21:39:01.693:INFO [launcher]: Starting browser PhantomJS
13 10 2016 21:39:02.717:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#iN8DZHviSAx3aI7RAAAA with id 42155207
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.004 secs / 0 secs)
[21:39:02] 'karma:single-run' errored after 5.79 s
[21:39:02] Error: Failed 1 tests.
at failCount (/Users/samredway/Development/crunchboards/cb-admin-panel/frontend/gulp_tasks/karma.js:13:22)
at removeAllListeners (/Users/samredway/Development/crunchboards/cb-admin-panel/frontend/node_modules/karma/lib/server.js:379:7)
at Server.<anonymous> (/Users/samredway/Development/crunchboards/cb-admin-panel/frontend/node_modules/karma/lib/server.js:390:9)
at Server.g (events.js:286:16)
at emitNone (events.js:91:20)
at Server.emit (events.js:185:7)
at emitCloseNT (net.js:1549:8)
at _combinedTickCallback (internal/process/next_tick.js:71:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
[21:39:02] 'test' errored after 5.79 s