-
Notifications
You must be signed in to change notification settings - Fork 46.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds new Jest configs for running our test suite using React Native feature flags. This includes a special config for the version of RN that Meta uses for internal dogfooding, similar to the equivalent ones used for Meta's web codebase. Practically speaking, the main benefit is we can run our tests in CI with the experimental flags used at Meta without having to enable them in the open source builds. Usage: yarn test -r=native-oss yarn test -r=native-fb yarn test -r=native-fb --no-variant
- Loading branch information
Showing
8 changed files
with
107 additions
and
22 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
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,21 @@ | ||
'use strict'; | ||
|
||
const baseConfig = require('./config.base'); | ||
|
||
module.exports = Object.assign({}, baseConfig, { | ||
modulePathIgnorePatterns: [ | ||
...baseConfig.modulePathIgnorePatterns, | ||
'packages/react-devtools-extensions', | ||
'packages/react-devtools-shared', | ||
'ReactIncrementalPerf', | ||
'ReactIncrementalUpdatesMinimalism', | ||
'ReactIncrementalTriangle', | ||
'ReactIncrementalReflection', | ||
'forwardRef', | ||
], | ||
setupFiles: [ | ||
...baseConfig.setupFiles, | ||
require.resolve('./setupTests.native-fb.js'), | ||
require.resolve('./setupHostConfigs.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,21 @@ | ||
'use strict'; | ||
|
||
const baseConfig = require('./config.base'); | ||
|
||
module.exports = Object.assign({}, baseConfig, { | ||
modulePathIgnorePatterns: [ | ||
...baseConfig.modulePathIgnorePatterns, | ||
'packages/react-devtools-extensions', | ||
'packages/react-devtools-shared', | ||
'ReactIncrementalPerf', | ||
'ReactIncrementalUpdatesMinimalism', | ||
'ReactIncrementalTriangle', | ||
'ReactIncrementalReflection', | ||
'forwardRef', | ||
], | ||
setupFiles: [ | ||
...baseConfig.setupFiles, | ||
require.resolve('./setupTests.native-oss.js'), | ||
require.resolve('./setupHostConfigs.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
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,17 @@ | ||
'use strict'; | ||
|
||
jest.mock('shared/ReactFeatureFlags', () => { | ||
jest.mock( | ||
'ReactNativeInternalFeatureFlags', | ||
() => | ||
jest.requireActual('shared/forks/ReactFeatureFlags.native-fb-dynamic'), | ||
{virtual: true} | ||
); | ||
return jest.requireActual('shared/forks/ReactFeatureFlags.native-fb'); | ||
}); | ||
|
||
jest.mock('react-noop-renderer', () => | ||
jest.requireActual('react-noop-renderer/persistent') | ||
); | ||
|
||
global.__PERSISTENT__ = true; |
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,11 @@ | ||
'use strict'; | ||
|
||
jest.mock('shared/ReactFeatureFlags', () => | ||
require('shared/forks/ReactFeatureFlags.native-oss') | ||
); | ||
|
||
jest.mock('react-noop-renderer', () => | ||
jest.requireActual('react-noop-renderer/persistent') | ||
); | ||
|
||
global.__PERSISTENT__ = true; |