Skip to content

Commit c87f090

Browse files
Tim Wangrquigley
authored andcommitted
Add BlobModule native module mock to jest setup
Summary: React Native v0.48.0 shipped `WebSocketModule` support with `BlobModule` as dependency. But `BlobModule` is not mocked in jest which will cause render tests failed. Reference implantation: [BlobModule.java](https://github.com/facebook/react-native/blob/ed903099b42259958d8a6eb3af1a6460c1bc8b2c/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java) Related PR: facebook#11417 Related issue: facebook#15810 Passed CI tests. Need render a component in jest with WebSocketModule as dependency. Closes facebook#15843 Differential Revision: D5783263 Pulled By: shergin fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
1 parent 641a08f commit c87f090

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

jest/setup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ const mockNativeModules = {
237237
Constants: {},
238238
},
239239
},
240+
BlobModule: {
241+
BLOB_URI_SCHEME: 'content',
242+
BLOB_URI_HOST: null,
243+
enableBlobSupport: jest.fn(),
244+
disableBlobSupport: jest.fn(),
245+
createFromParts: jest.fn(),
246+
sendBlob: jest.fn(),
247+
release: jest.fn(),
248+
},
240249
WebSocketModule: {
241250
connect: jest.fn(),
242251
send: jest.fn(),

0 commit comments

Comments
 (0)