这是Karma test runner
(有一个失败的测试)的默认输出:
.
..
...
e 28.0 (Windows): Executed 413 of 421 (1 FAILED)
e 28.0 (Windows): Executed 414 of 421 (1 FAILED)
e 28.0 (Windows): Executed 415 of 421 (1 FAILED)
e 28.0 (Windows): Executed 416 of 421 (1 FAILED)
e 28.0 (Windows): Executed 417 of 421 (1 FAILED)
e 28.0 (Windows): Executed 418 of 421 (1 FAILED)
e 28.0 (Windows): Executed 419 of 421 (1 FAILED)
e 28.0 (Windows): Executed 420 of 421 (1 FAILED)
e 28.0 (Windows): Executed 421 of 421 (1 FAILED)
e 28.0 (Windows): Executed 421 of 421 (1 FAILED) (1.74 secs / 1.091 secs)
我不喜欢这样一个事实,即必须一直滚动到未能看到异常的测试。随着时间的推移,这可能会变得烦人,所以我的问题是是否有可能以某种方式更改输出,以便在控制台中只报告失败的测试?
因此,如果测试失败,我希望输出类似于以下内容:
Chrome 28.0 (Windows) FailedTest only should be printed to console FAILED
ReferenceError: something is not defined
at null.<anonymous> (c:/SuperProject/src/test/FailedTest.js:10:10)
Chrome 28.0 (Windows): Executed 71 of 421 (1 FAILED)
而不是上面的输出。