मैं cli और jest.config.js को मिलाकर जेस्ट चलाना चाहता हूं, इसलिए मैं उसी कॉन्फिगरेशन का उपयोग कर सकता हूं लेकिन रन टाइम में मामूली बदलाव के साथ
jest --config=jest.config.js
का परिणाम
Test Suites: 1 failed, 163 passed, 164 total
Tests: 8 skipped, 1685 passed, 1693 total
Snapshots: 87 passed, 87 total
Time: 34.719s, estimated 44s
जबकि
jest --config=jest.config.js --testPathIgnorePatterns=[ignore]
का परिणाम
752 files checked.
testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 164 matches
testPathIgnorePatterns: [ignore] - 0 matches
testRegex: - 0 matches
Pattern: - 0 matches
error Command failed with exit code 1.
अगर मैं कॉन्फ़िगरेशन को संशोधित करता हूं
modulePathIgnorePatterns: [
'<rootDir>/src/.*/__mocks__',
'<rootDir>/node_modules',
'<rootDir>/.*/ignore',
],
का परिणाम
Test Suites: 163 passed, 163 total
Tests: 8 skipped, 1685 passed, 1693 total
Snapshots: 87 passed, 87 total
Time: 31.417s
3
mummybot
13 अगस्त 2020, 15:44
1 उत्तर
सबसे बढ़िया उत्तर
दस्तावेज बताता है कि testPathIgnorePatterns एक सरणी है। शेल में ऐरे अल्पविराम या स्थान से अलग होते हैं।
यह काम:
jest --config=jest.config.js --testPathIgnorePatterns=ignore
जैसा होगा:
jest --config=jest.config.js --testPathIgnorePatterns=ignore,ignoreThisAsWell
6
mummybot
13 अगस्त 2020, 16:20
संबंधित सवाल
नए सवाल
jestjs
Jest es un marco de pruebas unitarias de JavaScript creado por Facebook basado en Jasmine y proporciona creación automática de simulacros y un entorno jsdom. A menudo se usa para probar componentes de React.