| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | module.exports = function makeE2EConfig(displayName, useForget) { |
| 9 | return { |
| 10 | displayName, |
| 11 | testEnvironment: 'jsdom', |
| 12 | rootDir: '../../src', |
| 13 | testMatch: ['**/*.e2e.(js|tsx)'], |
| 14 | modulePathIgnorePatterns: [ |
| 15 | // ignore snapshots from the opposite forget configuration |
| 16 | useForget ? '.*\\.no-forget\\.snap$' : '.*\\.with-forget\\.snap$', |
| 17 | // ignore snapshots from the main project |
| 18 | '.*\\.ts\\.snap$', |
| 19 | ], |
| 20 | globals: { |
| 21 | __FORGET__: useForget, |
| 22 | }, |
| 23 | snapshotResolver: useForget |
| 24 | ? '<rootDir>/../scripts/jest/snapshot-resolver-with-forget.js' |
| 25 | : '<rootDir>/../scripts/jest/snapshot-resolver-no-forget.js', |
| 26 | |
| 27 | transform: { |
| 28 | '\\.[tj]sx?$': useForget |
| 29 | ? '<rootDir>/../scripts/jest/transform-with-forget' |
| 30 | : '<rootDir>/../scripts/jest/transform-no-forget', |
| 31 | }, |
| 32 | transformIgnorePatterns: ['/node_modules/'], |
| 33 | }; |
| 34 | }; |