mirror of
https://github.com/react/react-native.git
synced 2026-09-30 17:29:41 +08:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55725 changelog: [internal] By default, `yarn fantom` now excludes benchmark tests (`*-benchmark-itest.js` files) to speed up regular test runs. Benchmark tests are typically slower and used for performance analysis rather than correctness testing. Excluding them by default improves the developer experience for everyday test runs. To run benchmark tests, use the new `--benchmarks` flag: ``` yarn fantom --benchmarks ``` Reviewed By: andrewdacenko Differential Revision: D92150163 fbshipit-source-id: 4c40ef1ba542c4856221373d8239ba603e8f6620
36 lines
959 B
Bash
Executable File
36 lines
959 B
Bash
Executable File
#!/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
|
|
|
|
|
|
if [[ -f "BUCK" && -z "$FANTOM_FORCE_OSS_BUILD" ]]; then
|
|
export JS_DIR='..'
|
|
else
|
|
yarn workspace @react-native/fantom build
|
|
export FANTOM_FORCE_OSS_BUILD=1
|
|
fi
|
|
|
|
export NODE_OPTIONS='--max-old-space-size=8192'
|
|
|
|
# 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
|