我目前开始学习角度(v2),并希望进入测试阶段。
在我的第一个项目尝试失败后,我从这里克隆了官方的快速启动回购:
https://github.com/angular/quickstart
并尝试在那里启动测试:
npm test
有时测试按预期工作,但有时我会遇到一个奇怪的错误:
[1] Missing error handler on `socket`.
[1] TypeError: Cannot set property '60946738' of null
我发现了一些带有类似错误的提示(套接字部分),但下一行有(msg || "").replace is not a function
。这个错误似乎有所不同。
从控制台输出中我看到测试实际上已经运行。看起来错误发生在测试之后(一个测试失败实际上是预期的,因为我故意改变冒烟测试以使测试失败)。除了这个测试,我没有改变任何项目。
我的印象是,测试失败会更频繁地发生错误(但这可能完全不相关)。
知道什么是错的吗?
控制台输出的一大部分:
[1] 26 09 2016 15:47:03.221:WARN [web-server]: 404: /base/systemjs.config.extras.js
[1] Chrome 53.0.2785 (Windows 10 0.0.0) LOG: 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.'
[1]
[1] Chrome 53.0.2785 (Windows 10 0.0.0) LOG: Error{originalErr: Error{}}
[1]
Chrome 53.0.2785 (Windows 10 0.0.0) Smoke test should run a passing test FAILED
[1] Expected true to equal false, 'should pass'.
Chrome 53.0.2785 (Windows 10 0.0.0): Executed 3 of 3 (1 FAILED) (0.109 secs / 0.1 secs)
[1] 26 09 2016 15:47:03.732:WARN [web-server]: 404: /base/systemjs.config.extras.js
[1] Chrome 53.0.2785 (Windows 10 0.0.0) LOG: 'WARNING: System.import could not load "systemjs.config.extras.js"; continuing without it.'
[1]
[1] Chrome 53.0.2785 (Windows 10 0.0.0) LOG: Error{originalErr: Error{}}
[1]
Chrome 53.0.2785 (Windows 10 0.0.0): Executed 0 of 3 SUCCESS (0 secs / 0 secs)
[1] Missing error handler on `socket`.
[1] TypeError: Cannot set property '60946738' of null
[1] at createHtmlResults (C:\Users\username\Documents\Projekte\cc-dashboard-qs\cc-dashboard-qs\node_modules\karma-htmlfile-reporter\index.js:57:32)
[1] at initializeHtmlForBrowser (C:\Users\username\Documents\Projekte\cc-dashboard-qs\cc-dashboard-qs\node_modules\karma-htmlfile-reporter\index.js:78:5)
[1] at HTMLReporter.onBrowserStart (C:\Users\username\Documents\Projekte\cc-dashboard-qs\cc-dashboard-qs\node_modules\karma-htmlfile-reporter\index.js:91:5)
[1] at Server.<anonymous> (C:\Users\username\Documents\Projekte\cc-dashboard-qs\cc-dashboard-qs\node_modules\karma\lib\events.js:13:22)
[1] at emitTwo (events.js:111:20)
[1] at Server.emit (events.js:191:7)
[1] at Browser.onStart (C:\Users\username\Documents\Projekte\cc-dashboard-qs\cc-dashboard-qs\node_modules\karma\lib\browser.js:126:13)