react/scripts/jest/config.base.js
Jan Kassens 3f5b8c214f
Jest: remove haste config (#27257)
Since we're not using haste at all, we can just remove the config to
disable haste instead of enabling, just to inject an implementation that
blocks any haste modules from being recognized.

Test Plan:
Creating a module and required it to get the expected error that the
module doesn't exist.
2023-08-22 10:12:28 -04:00

32 lines
970 B
JavaScript

'use strict';
module.exports = {
globalSetup: require.resolve('./setupGlobal.js'),
modulePathIgnorePatterns: [
'<rootDir>/scripts/rollup/shims/',
'<rootDir>/scripts/bench/',
],
transform: {
'.*': require.resolve('./preprocessor.js'),
},
setupFiles: [require.resolve('./setupEnvironment.js')],
setupFilesAfterEnv: [require.resolve('./setupTests.js')],
// Only include files directly in __tests__, not in nested folders.
testRegex: '/__tests__/[^/]*(\\.js|\\.coffee|[^d]\\.ts)$',
moduleFileExtensions: ['js', 'json', 'node', 'coffee', 'ts'],
rootDir: process.cwd(),
roots: ['<rootDir>/packages', '<rootDir>/scripts'],
collectCoverageFrom: ['packages/**/*.js'],
fakeTimers: {
enableGlobally: true,
legacyFakeTimers: true,
},
snapshotSerializers: [require.resolve('jest-snapshot-serializer-raw')],
testSequencer: require.resolve('./jestSequencer'),
testEnvironment: 'jsdom',
testRunner: 'jest-circus/runner',
};