-
Notifications
You must be signed in to change notification settings - Fork 51k
update node.js version for CI to 16 #23243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -503,9 +503,13 @@ function runActTests(label, render, unmount, rerender) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spyOnDevAndProd(console, 'error'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // let's try to cheat and spin off a 'thread' with an act call | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await act(async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await sleep(50); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await act(async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await sleep(50); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (e) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // suppress ERR_UNHANDLED_REJECTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| global._test_gate = (gateFn, testName, callback) => { | |
| let shouldPass; | |
| try { | |
| const flags = getTestFlags(); | |
| shouldPass = gateFn(flags); | |
| } catch (e) { | |
| test(testName, () => { | |
| throw e; | |
| }); | |
| return; | |
| } | |
| if (shouldPass) { | |
| test(testName, callback); | |
| } else { | |
| test(`[GATED, SHOULD FAIL] ${testName}`, () => | |
| expectTestToFail(callback, gatedErrorMessage)); | |
| } | |
| }; |
The test is still run
react/scripts/jest/setupTests.js
Line 249 in cd4eb11
| const maybePromise = callback(); |
and the exception is not caught, trouble occurs.
since the assertions for this test are under __DEV__
react/packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
Lines 516 to 525 in cd4eb11
| if (__DEV__) { | |
| expect(console.error).toHaveBeenCalledTimes(2); | |
| expect(console.error.calls.argsFor(0)[0]).toMatch( | |
| 'You seem to have overlapping act() calls', | |
| ); | |
| expect(console.error.calls.argsFor(1)[0]).toMatch( | |
| 'You seem to have overlapping act() calls', | |
| ); | |
| } | |
| }); |
, I guess we can just use __DEV__ as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds reasonable
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -899,7 +899,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => { | |
| store.set({}); | ||
| }); | ||
| expect(container.textContent).toEqual( | ||
| "Cannot read property 'toUpperCase' of undefined", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "Cannot read properties of undefined (reading 'toUpperCase')", | ||
| ); | ||
| }); | ||
|
|
||
|
|
@@ -935,7 +935,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => { | |
| store.set({}); | ||
| }); | ||
| expect(container.textContent).toEqual( | ||
| "Cannot read property 'trim' of undefined", | ||
| "Cannot read properties of undefined (reading 'trim')", | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||




There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.