目前,我有两个文件夹:__tests__用于单元(快速)测试和__integration__慢速测试.
然后,在package.json:
{
"scripts": {
"test": "jest",
"test:integration": "jest -c '{}'",
...
},
"jest": {
"testPathIgnorePatterns": ["/node_modules/", "__integration__"]
}
}
Run Code Online (Sandbox Code Playgroud)
所以,当我想做TDD时,我正在运行npm test,当我想测试整个项目时,npm run test:integration.
由于Jest作为"无配置"测试框架提供,我在想是否有更好(或适当)的方式来配置它.
谢谢.
jestjs ×1