forked from zulip/zulip-mobile
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jest: Fix jestjs/jest#10221 locally.
This is much easier than forking React Native, as we considered in zulip/react-native#5. See jestjs/jest#10221 (comment).
- Loading branch information
1 parent
b653fef
commit de589cb
Showing
5 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* The preset we're making tweaks to. | ||
*/ | ||
const basePreset = require('../node_modules/jest-expo/android/jest-preset.js'); | ||
|
||
// See comment in our Jest config about how this is used. | ||
module.exports = { | ||
...basePreset, | ||
setupFiles: [ | ||
require.resolve('./savePromise.js'), | ||
...basePreset.setupFiles, | ||
require.resolve('./restorePromise.js'), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* The preset we're making tweaks to. | ||
*/ | ||
const basePreset = require('../node_modules/jest-expo/ios/jest-preset.js'); | ||
|
||
// See comment in our Jest config about how this is used. | ||
module.exports = { | ||
...basePreset, | ||
setupFiles: [ | ||
require.resolve('./savePromise.js'), | ||
...basePreset.setupFiles, | ||
require.resolve('./restorePromise.js'), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// For facebook/jest#10221. After savePromise.js and Jest's setup | ||
// files have run, restore the natural value of `global.Promise`. | ||
global.Promise = global.originalPromise; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// For facebook/jest#10221. Before Jest's setup files have run, take | ||
// note of what the natural value of `global.Promise` is, so we can | ||
// restore it in restorePromise.js. | ||
global.originalPromise = Promise; |