jest-expo 54.0.12 → 55.0.0-canary-20250919-7a31b96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -6
- package/src/preset/setup.js +19 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "55.0.0-canary-20250919-7a31b96",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"preset": "jest-expo/universal"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@expo/config": "
|
|
41
|
-
"@expo/json-file": "
|
|
40
|
+
"@expo/config": "12.0.10-canary-20250919-7a31b96",
|
|
41
|
+
"@expo/json-file": "10.0.8-canary-20250919-7a31b96",
|
|
42
42
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
43
43
|
"@jest/globals": "^29.2.1",
|
|
44
44
|
"babel-jest": "^29.2.1",
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
"stacktrace-js": "^2.0.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"expo": "
|
|
57
|
+
"expo": "55.0.0-canary-20250919-7a31b96",
|
|
58
58
|
"react-native": "*"
|
|
59
|
-
}
|
|
60
|
-
"gitHead": "0d9ae61f3dea2e2b854576859e5b50fca5503fc1"
|
|
59
|
+
}
|
|
61
60
|
}
|
package/src/preset/setup.js
CHANGED
|
@@ -192,7 +192,25 @@ jest.doMock('react-native/Libraries/LogBox/LogBox', () => ({
|
|
|
192
192
|
|
|
193
193
|
function attemptLookup(moduleName) {
|
|
194
194
|
// hack to get the package name from the module name
|
|
195
|
-
const filePath = stackTrace.getSync().find((line) =>
|
|
195
|
+
const filePath = stackTrace.getSync().find((line) => {
|
|
196
|
+
if (line.fileName.includes(moduleName)) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (!fs.existsSync(line.fileName)) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
const fileContents = fs.readFileSync(line.fileName, { encoding: 'utf8' });
|
|
204
|
+
// Matches requireNativeModule<OptionalGeneric>("ModuleName")
|
|
205
|
+
const regexPattern = new RegExp(
|
|
206
|
+
`require(?:Optional)?NativeModule\\s*(?:<${moduleName}Module>)?\\s*\\(['"]${moduleName}['"]\\)`
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
if (regexPattern.test(fileContents)) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
});
|
|
196
214
|
if (!filePath) {
|
|
197
215
|
return null;
|
|
198
216
|
}
|