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
29 lines
707 B
JavaScript
29 lines
707 B
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
|
|
*/
|
|
|
|
const isFB = require('./isFB');
|
|
|
|
if (isFB && process.env.FLIPPER_FB === undefined) {
|
|
process.env.FLIPPER_FB = 'true';
|
|
}
|
|
process.env.FLIPPER_TEST_RUNNER = 'true';
|
|
|
|
// eslint-disable-next-line import/no-unresolved,flipper/no-relative-imports-across-packages
|
|
const {transform} = require('../babel-transformer/lib/transform-jest');
|
|
|
|
module.exports = {
|
|
process(src, filename, options) {
|
|
return transform({
|
|
src,
|
|
filename,
|
|
options: {...options, isTestRunner: true},
|
|
});
|
|
},
|
|
};
|