mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[test] Exclude repository root from assertions (#35361)
This commit is contained in:
committed by
GitHub
parent
b061b597f7
commit
ba5b843692
@@ -6,6 +6,7 @@ const {
|
||||
resetAllUnexpectedConsoleCalls,
|
||||
patchConsoleMethods,
|
||||
} = require('internal-test-utils/consoleMock');
|
||||
const path = require('path');
|
||||
|
||||
if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
|
||||
// Inside the class equivalence tester, we have a custom environment, let's
|
||||
@@ -18,6 +19,9 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
|
||||
const spyOn = jest.spyOn;
|
||||
const noop = jest.fn;
|
||||
|
||||
// Can be used to normalize paths in stackframes
|
||||
global.__REACT_ROOT_PATH_TEST__ = path.resolve(__dirname, '../..');
|
||||
|
||||
// Spying on console methods in production builds can mask errors.
|
||||
// This is why we added an explicit spyOnDev() helper.
|
||||
// It's too easy to accidentally use the more familiar spyOn() helper though,
|
||||
|
||||
Reference in New Issue
Block a user