我正在使用 jest 進行集成測試,其中一個文件夾下有 20 個測試文件。我需要確保在運行測試時不需要執行該文件夾中的三個文件。我嘗試使用testPathIgnorePatterns但它僅適用于文件夾而不適用于文件。怎么做?笑話配置.js/** * @file Jest Integration Test Configuration File */module.exports = { roots: ['../../tests'], testRegex: '_*_integration.test.(js|ts|tsx)?$', globals: { 'ts-jest': { tsconfig: 'tsconfig.json', }, }, moduleFileExtensions: ['ts', 'js'], transform: { '^.+\\.(ts|tsx)$': 'ts-jest', }, testPathIgnorePatterns: ['tests/api/modules/m3/sample.test.ts'], testEnvironment: 'node', reporters: [ 'default', [ '../../node_modules/jest-html-reporter', { pageTitle: 'Integration Test Report', outputPath: 'tests/reports/integration-test-report.html', includeFailureMsg: true, }, ], ],};
如何在玩笑中跳過文件執行?
蝴蝶刀刀
2023-09-14 22:06:34