Skip to content

Commit

Permalink
Update open source env
Browse files Browse the repository at this point in the history
Summary:
We weren't exposing a mock for the batched bridge, which resulted in the WebSocket test failure but only in the open source copy of react-native.

public

Reviewed By: voideanvalue, vjeux

Differential Revision: D2782151

fb-gh-sync-id: e896097dd6060bc26963bc4c23db87b7277b3eba
  • Loading branch information
cpojer authored and facebook-github-bot-9 committed Dec 22, 2015
1 parent 6c02d5b commit 3ff3987
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jestSupport/env.js
Expand Up @@ -10,3 +10,9 @@

require('../packager/react-packager/src/Resolver/polyfills/babelHelpers.js');
global.__DEV__ = true;
global.__fbBatchedBridgeConfig = {
remoteModuleConfig: [],
localModulesConfig: [],
};

global.Promise = require('promise');

2 comments on commit 3ff3987

@cgreening
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks tests that use promises.

#6104

@chrisbobbe
Copy link

@chrisbobbe chrisbobbe commented on 3ff3987 Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks tests that use promises.

And again, if you're using the new "modern" fake timers in Jest 26.1.0; see jestjs/jest#10221.

Remove global.Promise = require('promise');, and it works again. (It lives in jest/setup.js now; it was moved at some point.)

Please sign in to comment.