2025-06-26 11:03:20 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2025-08-04 05:56:51 -07:00
|
|
|
|
2025-06-26 11:03:20 -07:00
|
|
|
if [[ -f "BUCK" && -z "$FANTOM_FORCE_OSS_BUILD" ]]; then
|
2025-08-04 05:56:51 -07:00
|
|
|
export JS_DIR='..'
|
2025-06-26 11:03:20 -07:00
|
|
|
else
|
2026-03-09 23:21:17 -07:00
|
|
|
if [[ ! -f "private/react-native-fantom/build/tester/fantom_tester" ]]; then
|
|
|
|
|
yarn workspace @react-native/fantom build
|
|
|
|
|
fi
|
2025-08-04 05:56:51 -07:00
|
|
|
export FANTOM_FORCE_OSS_BUILD=1
|
2025-06-26 11:03:20 -07:00
|
|
|
fi
|
2025-08-04 05:56:51 -07:00
|
|
|
|
|
|
|
|
export NODE_OPTIONS='--max-old-space-size=8192'
|
|
|
|
|
|
2026-02-25 03:17:00 -08:00
|
|
|
# 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
|