|
| 1 | +/* This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 4 | + |
| 5 | +module.exports = { |
| 6 | + testMatch: ['<rootDir>/src/**/*.test.{js,jsx,ts,tsx}'], |
| 7 | + moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'], |
| 8 | + |
| 9 | + testEnvironment: './src/test/custom-environment', |
| 10 | + setupFilesAfterEnv: [ |
| 11 | + 'jest-extended/all', |
| 12 | + './src/test/setup.ts', |
| 13 | + ], |
| 14 | + |
| 15 | + collectCoverageFrom: [ |
| 16 | + 'src/**/*.{js,jsx,ts,tsx}', |
| 17 | + '!**/node_modules/**', |
| 18 | + '!src/types/libdef/**', |
| 19 | + ], |
| 20 | + |
| 21 | + // Transform ESM modules to CommonJS for Jest |
| 22 | + // These packages ship as pure ESM and need to be transformed by Babel |
| 23 | + transformIgnorePatterns: [ |
| 24 | + '/node_modules/(?!(query-string|decode-uri-component|iongraph-web|split-on-first|filter-obj|fetch-mock)/)', |
| 25 | + ], |
| 26 | + |
| 27 | + // Mock static assets (images, CSS, etc.) |
| 28 | + moduleNameMapper: { |
| 29 | + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ftl)$': |
| 30 | + '<rootDir>/src/test/fixtures/mocks/file-mock.ts', |
| 31 | + '\\.(css|less)$': '<rootDir>/src/test/fixtures/mocks/style-mock.ts', |
| 32 | + }, |
| 33 | + |
| 34 | + globals: { |
| 35 | + AVAILABLE_STAGING_LOCALES: null, |
| 36 | + }, |
| 37 | + |
| 38 | + snapshotFormat: { |
| 39 | + escapeString: true, |
| 40 | + printBasicPrototype: true, |
| 41 | + }, |
| 42 | + verbose: false, |
| 43 | +}; |
0 commit comments