jest-expo 54.0.7 → 54.0.9
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "54.0.
|
|
3
|
+
"version": "54.0.9",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
43
43
|
"@jest/globals": "^29.2.1",
|
|
44
44
|
"babel-jest": "^29.2.1",
|
|
45
|
-
"find-up": "^5.0.0",
|
|
46
45
|
"jest-environment-jsdom": "^29.2.1",
|
|
47
46
|
"jest-snapshot": "^29.2.1",
|
|
48
47
|
"jest-watch-select-projects": "^2.0.0",
|
|
@@ -58,5 +57,5 @@
|
|
|
58
57
|
"expo": "*",
|
|
59
58
|
"react-native": "*"
|
|
60
59
|
},
|
|
61
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "87186d10c8239c6469e055417e67bd4d0ed63efb"
|
|
62
61
|
}
|
|
@@ -295,7 +295,6 @@ module.exports = {
|
|
|
295
295
|
{ name: 'isActivated', argumentsCount: 0, key: 'isActivated' },
|
|
296
296
|
],
|
|
297
297
|
ExpoLinearGradient: [],
|
|
298
|
-
ExpoLiquidGlassConstants: [],
|
|
299
298
|
ExpoLivePhoto: [],
|
|
300
299
|
ExpoLocalAuthentication: [
|
|
301
300
|
{ name: 'authenticateAsync', argumentsCount: 1, key: 'authenticateAsync' },
|
|
@@ -983,7 +982,7 @@ module.exports = {
|
|
|
983
982
|
addListener: { type: 'function' },
|
|
984
983
|
removeListeners: { type: 'function' },
|
|
985
984
|
},
|
|
986
|
-
|
|
985
|
+
ExpoGlassEffect: {
|
|
987
986
|
isLiquidGlassAvailable: { type: 'string' },
|
|
988
987
|
},
|
|
989
988
|
ExpoLivePhoto: { addListener: { type: 'function' }, removeListeners: { type: 'function' } },
|
package/src/preset/setup.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const fs = require('fs');
|
|
8
8
|
const merge = require('lodash/merge');
|
|
9
9
|
const path = require('path');
|
|
10
10
|
const mockNativeModules = require('react-native/Libraries/BatchedBridge/NativeModules').default;
|
|
@@ -196,9 +196,17 @@ function attemptLookup(moduleName) {
|
|
|
196
196
|
if (!filePath) {
|
|
197
197
|
return null;
|
|
198
198
|
}
|
|
199
|
-
const modulePath = findUp.sync('package.json', { cwd: filePath.fileName });
|
|
200
|
-
const moduleMockPath = path.join(modulePath, '..', 'mocks', moduleName);
|
|
201
199
|
|
|
200
|
+
let modulePath = null;
|
|
201
|
+
for (let dir = filePath.fileName; path.dirname(dir) !== dir; dir = path.dirname(dir)) {
|
|
202
|
+
const file = path.resolve(dir, 'package.json');
|
|
203
|
+
if (fs.existsSync(file)) {
|
|
204
|
+
modulePath = file;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const moduleMockPath = path.join(modulePath, '..', 'mocks', moduleName);
|
|
202
210
|
try {
|
|
203
211
|
const mockedPackageNativeModule = jest.requireActual(moduleMockPath);
|
|
204
212
|
return mockedPackageNativeModule;
|