Summary: ^ Basically, update Jest and fix any raised issues. Mainly: - Update necessary dependencies - Update snapshots - `useFakeTimers` caused a few issues which meant that the way we hook into the performance object had to be tweaked. The main code change is: `//fbsource/xplat/sonar/desktop/scripts/jest-setup-after.tsx` - `mocked` -> `jest.mocked` Changelog: Update Jest to v29.5.1 Reviewed By: antonk52 Differential Revision: D46319818 fbshipit-source-id: d218ca8f7e43abac6b00844953ddeb7f4e1010a2
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
module.exports = {
|
|
transform: {
|
|
'^.*__tests__(/|\\\\).*\\.tsx?$': 'ts-jest',
|
|
'\\.(js|tsx?)$': '<rootDir>/scripts/jest-transform.js',
|
|
},
|
|
setupFiles: ['<rootDir>/scripts/jest-setup.tsx'],
|
|
setupFilesAfterEnv: ['<rootDir>/scripts/jest-setup-after.tsx'],
|
|
moduleNameMapper: {
|
|
'^flipper$': '<rootDir>/app/src',
|
|
'^flipper-plugin$': '<rootDir>/flipper-plugin/src',
|
|
'^flipper-(server-core|ui-core|frontend-core|common)$':
|
|
'<rootDir>/flipper-$1/src',
|
|
'^flipper-(pkg|pkg-lib|doctor|test-utils)$': '<rootDir>/$1/src',
|
|
'^.+\\.(css|scss)$': '<rootDir>/scripts/jest-css-stub.js',
|
|
},
|
|
clearMocks: true,
|
|
coverageReporters: [
|
|
'json-summary',
|
|
'lcov',
|
|
'html',
|
|
...(process.env.COVERAGE_TEXT === 'detailed' ? ['text'] : []),
|
|
],
|
|
testMatch: ['**/**.(node|spec).(js|jsx|ts|tsx)'],
|
|
testEnvironment: 'jsdom',
|
|
resolver: '<rootDir>/jest.resolver.js',
|
|
};
|