diff --git a/jest.config.base.js b/jest.config.base.js index 8c5a1e7a2ae..4ab521251c8 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -1,7 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { isCI } from '@terascope/utils'; const dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -31,15 +30,11 @@ export default (projectDir) => { rootDir = '../../'; } - const coverageReporters = ['lcov', 'html']; - if (!isCI) { - coverageReporters.push('text-summary'); - } const config = { rootDir, displayName: name, - verbose: true, testEnvironment: 'node', + testTimeout: 60 * 1000, setupFilesAfterEnv: ['jest-extended/all'], testMatch: [`${packageRoot}/test/**/*-spec.{ts,js}`, `${packageRoot}/test/*-spec.{ts,js}`], testPathIgnorePatterns: [ @@ -57,14 +52,10 @@ export default (projectDir) => { }, moduleFileExtensions: ['ts', 'js', 'json', 'node', 'pegjs', 'mjs'], extensionsToTreatAsEsm: ['.ts'], - collectCoverage: true, coveragePathIgnorePatterns: ['/node_modules/', '/test/'], watchPathIgnorePatterns: [], - coverageReporters, coverageDirectory: `${packageRoot}/coverage`, - watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], workerIdleMemoryLimit: '200MB', - testTimeout: 60 * 1000, globals: { availableExtensions: ['.js', '.ts', '.mjs', 'cjs'], }, diff --git a/jest.config.js b/jest.config.js index 1a9b873c4e4..a726ba7a896 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,6 +35,8 @@ if (!isCI) { export default { rootDir: '.', verbose: true, + testTimeout: 60 * 1000, + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], projects, globals: { availableExtensions: ['.js', '.ts', '.mjs', '.cjs'], diff --git a/patches/README.md b/patches/README.md index 5ca715403e4..dc083ad0664 100644 --- a/patches/README.md +++ b/patches/README.md @@ -23,3 +23,13 @@ npx patch-package package/another-package ### Updating patches Use exactly the same process as for making patches in the first place, i.e. make more changes, run patch-package, commit the changes to the patch file. + +## Current Patches + +### jest-config + +`jest-config` needed a patch that fixes an issue that's stated here: + +[Unknown option testTimeout validation warning when used in project specific config](https://github.com/jestjs/jest/issues/14513) + +This is fixed on jest version 30 but it's still in beta. Once out of beta, this patch can be removed. diff --git a/patches/jest-config+29.7.0.patch b/patches/jest-config+29.7.0.patch new file mode 100644 index 00000000000..5cf26e4624d --- /dev/null +++ b/patches/jest-config+29.7.0.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/jest-config/build/ValidConfig.js b/node_modules/jest-config/build/ValidConfig.js +index 0c1250c..67e586e 100644 +--- a/node_modules/jest-config/build/ValidConfig.js ++++ b/node_modules/jest-config/build/ValidConfig.js +@@ -331,6 +331,7 @@ const initialProjectOptions = { + ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$'] + ), + testRunner: 'circus', ++ testTimeout: 5000, + transform: { + '\\.js$': '/preprocessor.js' + },