Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion private/react-native-fantom/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ module.exports = {
] /*:: as $ReadOnlyArray<string> */,
// This allows running Meta-internal tests with the `-test.fb.js` suffix.
testRegex: '/__tests__/.*-itest(\\.fb)?\\.js$',
testPathIgnorePatterns: baseConfig.testPathIgnorePatterns,
testPathIgnorePatterns: [
...baseConfig.testPathIgnorePatterns,
...(process.env.FANTOM_INCLUDE_BENCHMARKS != null
? []
: ['benchmark-itest']),
] /*:: as ReadonlyArray<string> */,
transformIgnorePatterns: ['.*'],
testRunner: '<rootDir>/private/react-native-fantom/runner/index.js',
watchPathIgnorePatterns: ['<rootDir>/private/react-native-fantom/build/'],
Expand Down
1 change: 1 addition & 0 deletions private/react-native-fantom/runner/EnvironmentOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const VALID_ENVIRONMENT_VARIABLES = [
'FANTOM_FORCE_CI_MODE',
'FANTOM_FORCE_OSS_BUILD',
'FANTOM_FORCE_TEST_MODE',
'FANTOM_INCLUDE_BENCHMARKS',
'FANTOM_LOG_COMMANDS',
'FANTOM_PRINT_OUTPUT',
'FANTOM_DEBUG_JS',
Expand Down
18 changes: 17 additions & 1 deletion scripts/fantom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@ fi

export NODE_OPTIONS='--max-old-space-size=8192'

yarn jest --config private/react-native-fantom/config/jest.config.js "$@"
# Parse arguments to check for --benchmarks flag
INCLUDE_BENCHMARKS=false
ARGS=()
for arg in "$@"; do
if [[ "$arg" == "--benchmarks" ]]; then
INCLUDE_BENCHMARKS=true
else
ARGS+=("$arg")
fi
done

# When --benchmarks is passed, set env var so jest.config.js includes benchmark tests
if [[ "$INCLUDE_BENCHMARKS" == true ]]; then
FANTOM_INCLUDE_BENCHMARKS=1 yarn jest --config private/react-native-fantom/config/jest.config.js "${ARGS[@]}"
else
yarn jest --config private/react-native-fantom/config/jest.config.js "${ARGS[@]}"
fi
Loading