fix after rebase
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
diff --git a/index.js b/index.js
|
||||
index 49b3650..a690ec8 100644
|
||||
--- a/index.js
|
||||
+++ b/index.js
|
||||
@@ -153,6 +153,15 @@ module.exports = function(api, options = {}) {
|
||||
const key = path.toComputedKey()
|
||||
if (t.isStringLiteral(key)) {
|
||||
const importedId = key.value
|
||||
+ // Metro uses Jest workers to transform application code. Do not
|
||||
+ // leak the build worker's ID into the application runtime, where
|
||||
+ // libraries can mistake it for an actual test environment.
|
||||
+ if (
|
||||
+ importedId === 'JEST_WORKER_ID' ||
|
||||
+ importedId === 'VITEST_WORKER_ID'
|
||||
+ ) {
|
||||
+ return
|
||||
+ }
|
||||
const value = (env && importedId in env) ? env[importedId] : process.env[importedId]
|
||||
if (value !== undefined) {
|
||||
path.replaceWith(t.valueToNode(value))
|
||||
@@ -1,4 +0,0 @@
|
||||
# react-native-dotenv@3.4.11.patch
|
||||
|
||||
Avoid inlining Metro's `JEST_WORKER_ID` or `VITEST_WORKER_ID` into application
|
||||
code, which causes libraries such as react-native-mmkv to use test-only mocks.
|
||||
@@ -40,7 +40,6 @@ patchedDependencies:
|
||||
'expo-updates@57.0.10': patches/expo-updates@57.0.10.patch
|
||||
expo@57.0.8: patches/expo@57.0.8.patch
|
||||
'react-native-date-picker@5.0.13': patches/react-native-date-picker@5.0.13.patch
|
||||
'react-native-dotenv@3.4.11': patches/react-native-dotenv@3.4.11.patch
|
||||
'react-native-drawer-layout@4.2.3': patches/react-native-drawer-layout@4.2.3.patch
|
||||
'react-native-keyboard-controller@1.21.9': patches/react-native-keyboard-controller@1.21.9.patch
|
||||
'react-native-pager-view@6.8.0': patches/react-native-pager-view@6.8.0.patch
|
||||
|
||||
Reference in New Issue
Block a user