File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
.github/actions/setup-deps-rn-nightly Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 3030 run : |
3131 yarn add -D \
3232 react-native@nightly \
33- @react-native/babel-preset@nightly
33+ @react-native/babel-preset@nightly \
34+ @react-native/jest-preset@nightly
35+ shell : bash
36+
37+ - name : Patch jest.config.js for nightly preset
38+ run : bash scripts/setup-rn-jest-preset.sh
3439 shell : bash
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
5+ CONFIG_PATH=" $SCRIPT_DIR /../jest.config.js"
6+
7+ if ! grep -q " preset: 'react-native'" " $CONFIG_PATH " ; then
8+ echo " ❌ Could not find preset: 'react-native' in jest.config.js"
9+ exit 1
10+ fi
11+
12+ sed -i.bak " s/preset: 'react-native'/preset: '@react-native\/jest-preset'/" " $CONFIG_PATH "
13+ rm -f " $CONFIG_PATH .bak"
14+ echo " ✅ jest.config.js patched: preset set to @react-native/jest-preset"
You can’t perform that action at this time.
0 commit comments