Browse files

Add BlobModule native module mock to jest setup

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: [](

Related PR: #11417
Related issue: #15810

Passed CI tests.
Need render a component in jest with WebSocketModule as dependency.
Closes #15843

Differential Revision: D5783263

Pulled By: shergin

fbshipit-source-id: 2386692f4a644796da2fd66b3135da9f5911663e
  • Loading branch information...
timwangdev authored and ide committed Sep 7, 2017
1 parent a41995f commit 1f85e2146495aad41056e46db4249ec3b568bbf3
Showing with 9 additions and 0 deletions.
  1. +9 −0 jest/setup.js
@@ -275,6 +275,15 @@ const mockNativeModules = {
Constants: {},
BlobModule: {
BLOB_URI_SCHEME: 'content',
enableBlobSupport: jest.fn(),
disableBlobSupport: jest.fn(),
createFromParts: jest.fn(),
sendBlob: jest.fn(),
release: jest.fn(),
WebSocketModule: {
connect: jest.fn(),
send: jest.fn(),

0 comments on commit 1f85e21

Please sign in to comment.