Typescript 如何执行不以spec.ts结尾或以Jest结尾的test.ts的测试文件
我试图区分单元测试和集成测试,并将它们分离到特定的文件中 更准确地说,我想使用Typescript 如何执行不以spec.ts结尾或以Jest结尾的test.ts的测试文件,typescript,unit-testing,jestjs,integration-testing,Typescript,Unit Testing,Jestjs,Integration Testing,我试图区分单元测试和集成测试,并将它们分离到特定的文件中 更准确地说,我想使用inte.ts文件扩展名进行集成测试 我一天大概运行30次单元测试。我只希望在我选择的时候运行集成(可能一天一次) 但显然我不能只是执行: ➜ bff-candidates git:(develop) jest src/me/repository/me.repository.inte.ts No tests found, exiting with code 1 Run with `--passWithNoTests`
inte.ts
文件扩展名进行集成测试
我一天大概运行30次单元测试。我只希望在我选择的时候运行集成(可能一天一次)
但显然我不能只是执行:
➜ bff-candidates git:(develop) jest src/me/repository/me.repository.inte.ts
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /Users/amehmeto/HeroesJobs/BFF/bff-candidates/src
137 files checked.
testMatch: - 0 matches
testPathIgnorePatterns: /node_modules/ - 137 matches
testRegex: .spec.ts$ - 32 matches
Pattern: src/me/repository/me.repository.inte.ts - 0 matches
如何实现这一点?您必须在jest配置的testMatch或testRegex属性中配置所需的模式 在本例中,应该类似于:
testMatch:[“**/inte.ts?(x)”]