| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import type {Config} from '@jest/types'; |
| b69ab31 | | | 9 | |
| b69ab31 | | | 10 | const config: Config.InitialOptions = { |
| b69ab31 | | | 11 | verbose: true, |
| b69ab31 | | | 12 | testRegex: '/integrationTests/.*\\.test\\.tsx?', |
| b69ab31 | | | 13 | |
| b69ab31 | | | 14 | // shutting down watchman is async, so our `dispose` does not synchronously tear down everything, |
| b69ab31 | | | 15 | // thus jest thinks we have leaked handles. Force exits quiets this warning. |
| b69ab31 | | | 16 | forceExit: true, |
| b69ab31 | | | 17 | |
| b69ab31 | | | 18 | // Even though the repos are separate, somehow running multiple integration tests in parallel |
| b69ab31 | | | 19 | // causes failures. For now, just limit to one test at a time. |
| b69ab31 | | | 20 | maxWorkers: 1, |
| b69ab31 | | | 21 | |
| b69ab31 | | | 22 | // use typescript in tests |
| b69ab31 | | | 23 | preset: 'ts-jest', |
| b69ab31 | | | 24 | testEnvironment: 'jsdom', |
| b69ab31 | | | 25 | rootDir: '..', |
| b69ab31 | | | 26 | setupFilesAfterEnv: ['<rootDir>/integrationTests/setupTests.ts'], |
| b69ab31 | | | 27 | testTimeout: 120_000, |
| b69ab31 | | | 28 | |
| b69ab31 | | | 29 | modulePaths: ['<rootDir>/src'], |
| b69ab31 | | | 30 | moduleNameMapper: { |
| b69ab31 | | | 31 | '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': |
| b69ab31 | | | 32 | '<rootDir>/src/__mocks__/fileMock.js', |
| b69ab31 | | | 33 | '\\.css$': '<rootDir>/src/__mocks__/styleMock.ts', |
| b69ab31 | | | 34 | }, |
| b69ab31 | | | 35 | transform: { |
| b69ab31 | | | 36 | '^.+\\.tsx?$': '<rootDir>/jest-transformer-import-meta.cjs', |
| b69ab31 | | | 37 | }, |
| b69ab31 | | | 38 | transformIgnorePatterns: [ |
| b69ab31 | | | 39 | '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$', |
| b69ab31 | | | 40 | '^.+\\.module\\.(css|sass|scss)$', |
| b69ab31 | | | 41 | ], |
| b69ab31 | | | 42 | }; |
| b69ab31 | | | 43 | export default config; |