【发布时间】:2015-06-25 16:10:25
【问题描述】:
我有一个非常简单的 API 测试用例,使用 loopback-testing 模块完成。
lt = require('loopback-testing')
assert = require('assert')
describe '/profile', ->
lt.beforeEach.withApp app
lt.describe.whenCalledRemotely 'GET', '/api/profiles/ping', { data: 'test' }, ->
lt.it.shouldBeAllowed()
it 'should have statusCode 200', ->
assert.equal @res.statusCode, 200
it 'should have pong response', ->
assert.equal @res.body.pong, 'test'
作为测试的结果,我在系统控制台上打印出这样的行:
/profile
GET /api/profiles/ping
GET /api/profiles/ping 200 50.639 ms - 15
✓ should be allowed
GET /api/profiles/ping 200 8.026 ms - 15
✓ should have statusCode 200
GET /api/profiles/ping 200 3.633 ms - 15
✓ should have pong response
有没有办法通过环回测试模块关闭将这些行写入系统控制台?这简直是破坏了我的 mocha 报告概述。
【问题讨论】:
标签: javascript node.js loopbackjs strongloop