node.js - 玩笑测试中过于冗长的日志记录
问题描述
➤ YN0000: [@bb/graph]: console.log
➤ YN0000: [@bb/graph]: info: after all completed
➤ YN0000: [@bb/graph]:
➤ YN0000: [@bb/graph]: at Console.log (../.yarn/cache/winston-npm-3.3.3-3fa4527b42-8a9d69c642.zip/node_modules/winston/lib/winston/transports/console.js:79:23)
我得到了这个过于冗长的输出(主要是我不想看到这些console.log
东西,只是info: after all completed
在我的测试输出中。
我正在使用 yarn2、jest 和 winston,我不认为它是 winston,因为它不支持记录行号,而且当我在测试之外启动服务器时不会发生这种情况。我也不认为它是 yarn2 ,因为它发生在我运行时yarn workspace @bb/graph test
,它不包含前缀。这让我猜这是开玩笑。这是我的配置。
module.exports = {
preset: 'ts-jest',
coverageDirectory: 'coverage',
coverageReporters: [
'text-summary',
],
coverageThreshold: {
global: {
branches: 50,
functions: 65,
lines: 80,
statements: 80,
},
},
setupFiles: ['./jest.setup.js'],
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.ts', '**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/build/'],
};
其他一切都是默认值。
解决方案
推荐阅读
- navigation - 颤振通过路由导航到其他屏幕每隔一个屏幕更新一次
- android - 如何在本机后台服务中使用(角度)HTTP 客户端 - NativeScript
- java - 在 libgdx 游戏中将 GoogleMap 显示为片段
- python - 将循环中的数据框写入多个 Excel 文件
- gcc - 如何将 ilogb 与 newLib 一起使用?
- python - Movidius 和模板匹配
- php - Laravel api http 请求在 2 个具有不同浏览器的客户端上排序/排队
- javascript - 完成时的 AJAX 递归回调
- python - Python 中 Beautiful Soup XML 解析的问题
- http-headers - 在响应标头中隐藏 mobilefirst 7 服务器信息