如何解决玩笑测试中的日志记录过于冗长
➤ 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/'],};
其他均为默认设置。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。