Files
react-native/packages/react-native-fantom/runner/entrypoint-template.js
T
Tim Yung 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00

77 lines
2.0 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.
*
* @flow strict-local
* @format
*/
import type {SnapshotConfig} from '../runtime/snapshotContext';
import type {
FantomTestConfigJsOnlyFeatureFlags,
FantomTestConfigReactInternalFeatureFlags,
} from './getFantomTestConfig';
module.exports = function entrypointTemplate({
testPath,
setupModulePath,
featureFlagsModulePath,
featureFlags,
reactInternalFeatureFlags,
snapshotConfig,
isRunningFromCI,
}: {
testPath: string,
setupModulePath: string,
featureFlagsModulePath: string,
featureFlags: FantomTestConfigJsOnlyFeatureFlags,
reactInternalFeatureFlags: FantomTestConfigReactInternalFeatureFlags,
snapshotConfig: SnapshotConfig,
isRunningFromCI: boolean,
}): string {
return `/**
* 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.
*
* ${'@'}generated
* @noformat
* @noflow
*/
import {registerTest} from '${setupModulePath}';
import {setConstants} from '@react-native/fantom';
${
Object.keys(featureFlags).length > 0
? `import * as ReactNativeFeatureFlags from '${featureFlagsModulePath}';
ReactNativeFeatureFlags.override({
${Object.entries(featureFlags)
.map(([name, value]) => ` ${name}: () => ${JSON.stringify(value)},`)
.join('\n')}
});`
: ''
}
${
Object.keys(reactInternalFeatureFlags).length > 0
? `import ReactNativeInternalFeatureFlags from 'ReactNativeInternalFeatureFlags';
${Object.entries(reactInternalFeatureFlags)
.map(
([name, value]) =>
`ReactNativeInternalFeatureFlags.${name} = ${JSON.stringify(value)};`,
)
.join('\n')}`
: ''
}
setConstants({
isRunningFromCI: ${String(isRunningFromCI)},
});
registerTest(() => require('${testPath}'), ${JSON.stringify(snapshotConfig)});
`;
};