addons/isl/integrationTests/integration.jest.config.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import type {Config} from '@jest/types';
b69ab319
b69ab3110const config: Config.InitialOptions = {
b69ab3111 verbose: true,
b69ab3112 testRegex: '/integrationTests/.*\\.test\\.tsx?',
b69ab3113
b69ab3114 // shutting down watchman is async, so our `dispose` does not synchronously tear down everything,
b69ab3115 // thus jest thinks we have leaked handles. Force exits quiets this warning.
b69ab3116 forceExit: true,
b69ab3117
b69ab3118 // Even though the repos are separate, somehow running multiple integration tests in parallel
b69ab3119 // causes failures. For now, just limit to one test at a time.
b69ab3120 maxWorkers: 1,
b69ab3121
b69ab3122 // use typescript in tests
b69ab3123 preset: 'ts-jest',
b69ab3124 testEnvironment: 'jsdom',
b69ab3125 rootDir: '..',
b69ab3126 setupFilesAfterEnv: ['<rootDir>/integrationTests/setupTests.ts'],
b69ab3127 testTimeout: 120_000,
b69ab3128
b69ab3129 modulePaths: ['<rootDir>/src'],
b69ab3130 moduleNameMapper: {
b69ab3131 '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
b69ab3132 '<rootDir>/src/__mocks__/fileMock.js',
b69ab3133 '\\.css$': '<rootDir>/src/__mocks__/styleMock.ts',
b69ab3134 },
b69ab3135 transform: {
b69ab3136 '^.+\\.tsx?$': '<rootDir>/jest-transformer-import-meta.cjs',
b69ab3137 },
b69ab3138 transformIgnorePatterns: [
b69ab3139 '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$',
b69ab3140 '^.+\\.module\\.(css|sass|scss)$',
b69ab3141 ],
b69ab3142};
b69ab3143export default config;