【问题标题】:Plain text reporter for VitestVitest 的纯文本记者
【发布时间】:2022-10-25 13:40:37
【问题描述】:
我想知道是否有人为 vitest 提供了一个纯文本报告器,它与 Jenkins CI 和其他不支持彩色文本的显示器配合得很好。几乎不可能阅读 Jenkins 输出,或者如果我在 Sublime Text 中作为构建运行测试。
【问题讨论】:
标签:
jenkins
continuous-integration
vitest
【解决方案1】:
解决方案
您需要在 Jenkins 构建中设置以下环境变量:
NO_COLOR = 'true'
当您使用 Jenkinsfile 时,它看起来像这样:
pipeline {
agent any
environment {
NO_COLOR = 'true'
}
stages {
stage('test') {
agent {
docker {
image 'node:16.17.0'
reuseNode true
}
}
environment {
HOME = '.'
}
steps {
sh 'npm install'
sh 'npm run jenkinsTest'
}
}
}
}
解释
资源
https://github.com/vitest-dev/vitest/issues/841#issuecomment-1048997432