mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-23 23:10:17 +05:30
fix(test): exclude dist/ from Jest haste map
electron-builder's .snap (Squashfs) artifact in dist/ registered as an obsolete Jest snapshot file, failing the suite exit code despite all 516 tests passing. modulePathIgnorePatterns keeps the snapshot scanner out of build output. Amit Haridas
This commit is contained in:
+10
-12
@@ -11,10 +11,7 @@ module.exports = {
|
|||||||
rootDir: '.',
|
rootDir: '.',
|
||||||
|
|
||||||
// Test file patterns
|
// Test file patterns
|
||||||
testMatch: [
|
testMatch: ['**/tests/**/*.test.js', '**/tests/**/*.spec.js'],
|
||||||
'**/tests/**/*.test.js',
|
|
||||||
'**/tests/**/*.spec.js'
|
|
||||||
],
|
|
||||||
|
|
||||||
// Coverage configuration
|
// Coverage configuration
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
@@ -22,7 +19,7 @@ module.exports = {
|
|||||||
'!src/main.js', // Main process needs electron-mock
|
'!src/main.js', // Main process needs electron-mock
|
||||||
'!src/renderer.js', // Large renderer file with duplicate declarations
|
'!src/renderer.js', // Large renderer file with duplicate declarations
|
||||||
'!src/preload.js', // Electron preload requires contextBridge
|
'!src/preload.js', // Electron preload requires contextBridge
|
||||||
'!**/node_modules/**'
|
'!**/node_modules/**',
|
||||||
],
|
],
|
||||||
|
|
||||||
// Coverage thresholds (raised with expanded test suite)
|
// Coverage thresholds (raised with expanded test suite)
|
||||||
@@ -31,8 +28,8 @@ module.exports = {
|
|||||||
branches: 10,
|
branches: 10,
|
||||||
functions: 15,
|
functions: 15,
|
||||||
lines: 15,
|
lines: 15,
|
||||||
statements: 15
|
statements: 15,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Transform settings (no transpilation needed for vanilla JS)
|
// Transform settings (no transpilation needed for vanilla JS)
|
||||||
@@ -45,10 +42,11 @@ module.exports = {
|
|||||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
||||||
|
|
||||||
// Ignore patterns
|
// Ignore patterns
|
||||||
testPathIgnorePatterns: [
|
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||||
'/node_modules/',
|
|
||||||
'/dist/'
|
// Keep the haste map / snapshot scanner out of build output — electron-builder's
|
||||||
],
|
// .snap (Squashfs) artifacts otherwise register as obsolete Jest snapshots.
|
||||||
|
modulePathIgnorePatterns: ['/dist/'],
|
||||||
|
|
||||||
// Verbose output
|
// Verbose output
|
||||||
verbose: true,
|
verbose: true,
|
||||||
@@ -57,5 +55,5 @@ module.exports = {
|
|||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
|
|
||||||
// Reset modules between tests
|
// Reset modules between tests
|
||||||
resetModules: true
|
resetModules: true,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user