Javascript AssertionError-输出有噪声。如何仅显示断言

Javascript AssertionError-输出有噪声。如何仅显示断言,javascript,debugging,intern,Javascript,Debugging,Intern,从《入门》开始运行Intern单元测试示例时,当我更改Hello单元脚本并运行它以使其断言时,它似乎显示了比我需要的更多的细节(嘈杂)。这个输出正确吗?有没有办法只显示AssertionError行,或者显示发生此断言的文件/行 unit_hello.js: define([ 'intern!object', 'intern/chai!assert', 'app/hello' ], function (registerSuite, assert, hello) { reg

从《入门》开始运行Intern单元测试示例时,当我更改Hello单元脚本并运行它以使其断言时,它似乎显示了比我需要的更多的细节(嘈杂)。这个输出正确吗?有没有办法只显示AssertionError行,或者显示发生此断言的文件/行

unit_hello.js:

define([
    'intern!object',
    'intern/chai!assert',
    'app/hello'
], function (registerSuite, assert, hello) {
registerSuite({
    name: 'hello',

    greet: function () {
        assert.strictEqual(hello.greet('Name'), 'Hello, Name!',
            'hello.greet should return a greeting for the person name in the first argument');
        assert.strictEqual(hello.greet(), 'Hello, World!',
            'hello.greet with no arguments should return a greeting to "world"');
        }
    });
});
输出:

user@pcname:~/intern_example$ ./node_modules/.bin/intern-client config=tests/intern_unit
FAIL: main - hello - greet (1ms)
AssertionError: hello.greet with no arguments should return a greeting to "world":  expected 'Hello, world!' to equal 'Hello, World!'
  at Function.assert.strictEqual  <node_modules/intern/node_modules/chai/chai.js:2487:32>
  at Test.registerSuite.greet [as test]  <tests/unit/unit_hello.js:13:20>
  at Test.run  <node_modules/intern/lib/Test.js:169:19>
  at <node_modules/intern/lib/Suite.js:237:13>
  at signalListener  <node_modules/intern/node_modules/dojo/Deferred.js:37:21>
  at Promise.then.promise.then  <node_modules/intern/node_modules/dojo/Deferred.js:258:5>
  at runTest  <node_modules/intern/lib/Suite.js:236:46>
  at <node_modules/intern/lib/Suite.js:249:7>
  at process._tickCallback  <node.js:419:13>
1/1 tests failed
1/1 tests failed
user@pcname:~/intern\u示例$。/node\u modules/.bin/intern client config=tests/intern\u unit
失败:主-问候-问候(1ms)
AssertionError:hello.greet(不带参数)应向“world”返回问候语:应为“hello,world!”等于“你好,世界!”
在Function.assert.qual
at Test.registerSuite.greet[作为测试]
在测试运行时
在
在signalListener
那就答应吧
运行测试时
在
在进程中。\u
1/1测试失败
1/1测试失败

您可以编写并加载自己的,以输出您想要或不想要的任何信息。标准报告程序将始终提供完整的堆栈跟踪。

有一个配置选项,告诉Intern通过删除非应用程序代码来清除错误堆栈跟踪

它是从版本3.4(2016年11月18日发布)开始的