jest-serial-runner
扩展 欢乐 默认按顺序运行测试的运行程序
简单的包裹在默认的 Jest 运行器上 强制执行测试文件 。 这相当于运行 --runInBand 默认标记.
为什么? 有时您在测试机上拥有有限的/有限的资源( 如在嵌入容器中) 并运行默认 jest-runner 除非另有说明,否则总是平行运行。 一体化测试是另一种情景,即同时运行的情况引起问题,因此使用这一跑道只能确保一次运行一次测试.
安装
npm install @codejedi365/jest-serial-runner --save-dev
使用量
备选案文1: 指定您中的跑者 Jest 配置
/* jest.config.json */
{
// ...
"runner": "@codejedi365/jest-serial-runner"
// ...
}
备选案文2: 指定用于集成测试等子集文件的运行者 .
/* jest.config.js */
module.exports = {
// ...
projects: [
{
// Uses the jest default runner for specification testing
displayName: "UNIT",
testMatch: ["<rootDir>/src/**/__tests__/*.spec.ts"]
},
{
// Uses the serial runner instead for integration test files
displayName: "INTEGRATION",
runner: "@codejedi365/jest-serial-runner",
testMatch: ["<rootDir>/tests/**/*.integration-test.ts"]
}
]
}
贡献者
公关和发行捐款欢迎! 请遵守 提供指南 或您的提交将被关闭或延迟.
鸣谢
来源 : 加布里埃利/最新系列跑车
贡献者