我开了一张票,但如果这是正常和可以接受的,它立即关闭,没有任何信息;
我会在这里发布问题。
认为这是正常的可能是我职业生涯迄今为止最大的错误之一。我在修改 CodeSandbox 并注意到测试与我习惯的相比是多么的即时。设置一个基本的模板项目,这是我的结果:
{
"name": "jest-performance-test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"test": "mocha"
},
"dependencies": {
"chai": "^4.2.0",
"jest": "^23.0.0"
},
"devDependencies": {
"mocha": "^7.1.0"
}
}
Run Code Online (Sandbox Code Playgroud)
jest.config.js
{
"testRegex": "__tests__/*",
"testEnvironment": "node",
}
Run Code Online (Sandbox Code Playgroud)
几十个重复的测试
const {expect} = require('chai')
it ('should run the test', async () => {
expect (true).to.be.true
})
//...
Run Code Online (Sandbox Code Playgroud)
每个
运行jest --watch,进行更改并保存:
运行yarn run test --watch( mocha --watch),进行更改并保存:
--runInBand 让它变得更糟。
我明白了,我在 HDD 上使用 5y/o Windows …