Files
react-native/packages/react-native-fantom/config/jest.config.js
T
Rubén Norte 07a7b63fdd Only prewarm in CI (#48151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48151

Changelog: [internal]

We have global setup step in Fantom to prewarm caches to properly attribute test running time, but this isn't necessary when running tests locally. Attribution isn't as important there. This disables the prewarming step so we can run individual tests as fast as we can.

Reviewed By: sammy-SC

Differential Revision: D66877990

fbshipit-source-id: 1f33c19a3c537c1c0e499fd7a6c405450cb9f86d
2024-12-09 05:43:27 -08:00

37 lines
1.2 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
*/
'use strict';
const baseConfig = require('../../../jest.config');
const path = require('path');
const isCI = Boolean(process.env.SANDCASTLE || process.env.GITHUB_ACTIONS);
module.exports = {
rootDir: path.resolve(__dirname, '../../..'),
roots: [
'<rootDir>/packages/react-native',
'<rootDir>/packages/react-native-fantom',
],
moduleFileExtensions: [...baseConfig.moduleFileExtensions, 'cpp', 'h'],
// This allows running Meta-internal tests with the `-test.fb.js` suffix.
testRegex: '/__tests__/.*-itest(\\.fb)?\\.js$',
testPathIgnorePatterns: baseConfig.testPathIgnorePatterns,
transformIgnorePatterns: ['.*'],
testRunner: '<rootDir>/packages/react-native-fantom/runner/index.js',
watchPathIgnorePatterns: ['<rootDir>/packages/react-native-fantom/build/'],
// In CI, we want to prewarm the caches/builds before running the tests so
// that time isn't attributed to the first test that runs.
globalSetup: isCI
? '<rootDir>/packages/react-native-fantom/runner/warmup/index.js'
: null,
};