jest-expo 50.0.0-alpha.1 → 50.0.0-alpha.2
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 +2 -2
- package/src/preset/setup.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "50.0.0-alpha.
|
|
3
|
+
"version": "50.0.0-alpha.2",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "https://github.com/expo/expo/issues"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/expo/expo/tree/main/packages/jest-expo",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ee2c866ba3c7fbc35ff2a3e896041cf15d3bd7c5"
|
|
51
51
|
}
|
package/src/preset/setup.js
CHANGED
|
@@ -162,6 +162,8 @@ jest.doMock('react-native/Libraries/LogBox/LogBox', () => ({
|
|
|
162
162
|
try {
|
|
163
163
|
jest.mock('expo-modules-core', () => {
|
|
164
164
|
const ExpoModulesCore = jest.requireActual('expo-modules-core');
|
|
165
|
+
const uuid = jest.requireActual('expo-modules-core/build/uuid/uuid.web');
|
|
166
|
+
|
|
165
167
|
const { NativeModulesProxy } = ExpoModulesCore;
|
|
166
168
|
|
|
167
169
|
// After the NativeModules mock is set up, we can mock NativeModuleProxy's functions that call
|
|
@@ -171,6 +173,11 @@ try {
|
|
|
171
173
|
//
|
|
172
174
|
// NOTE: The adapter validates the number of arguments, which we don't do in the mocked functions.
|
|
173
175
|
// This means the mock functions will not throw validation errors the way they would in an app.
|
|
176
|
+
|
|
177
|
+
// Mock the `uuid` object with the implementation for web.
|
|
178
|
+
ExpoModulesCore.uuid.v4 = uuid.default.v4;
|
|
179
|
+
ExpoModulesCore.uuid.v5 = uuid.default.v5;
|
|
180
|
+
|
|
174
181
|
for (const moduleName of Object.keys(NativeModulesProxy)) {
|
|
175
182
|
const nativeModule = NativeModulesProxy[moduleName];
|
|
176
183
|
for (const propertyName of Object.keys(nativeModule)) {
|