Javascript 如何关闭strongloop环回测试控制台日志记录?
我使用环回测试模块完成了一个非常简单的API测试用例Javascript 如何关闭strongloop环回测试控制台日志记录?,javascript,node.js,loopbackjs,strongloop,Javascript,Node.js,Loopbackjs,Strongloop,我使用环回测试模块完成了一个非常简单的API测试用例 lt = require('loopback-testing') assert = require('assert') describe '/profile', -> lt.beforeEach.withApp app lt.describe.whenCalledRemotely 'GET', '/api/profiles/ping', { data: 'test' }, -> lt.it.shouldBeAl
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
有没有办法通过环回测试模块来关闭将这些行写入系统控制台的功能?它只是垃圾我的摩卡报告概述。您的应用程序中配置了日志中间件吗?额外的行看起来像由生成的HTTP访问日志
运行测试时,需要禁用应用程序中的任何HTTP日志记录中间件。这方面的说明取决于您是如何配置此中间件的,您能否扩展您的问题并描述您的应用程序设置?您的应用程序中是否配置了日志中间件?额外的行看起来像由生成的HTTP访问日志 运行测试时,需要禁用应用程序中的任何HTTP日志记录中间件。这方面的说明取决于您是如何配置此中间件的,您能否扩展您的问题并描述您的应用程序设置