Skip to content

Commit 5405fae

Browse files
committed
Fix gates for real this time
1 parent c1b9f9c commit 5405fae

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,20 @@ describe('ReactErrorBoundaries', () => {
882882
expect(container.firstChild.textContent).toBe('Caught an error: Hello.');
883883
});
884884

885-
// @gate !(disableModulePatternComponents && disableLegacyContext)
886-
it('renders an error state if module-style context provider throws in componentWillMount', () => {
885+
// @gate !disableModulePatternComponents
886+
// @gate !disableLegacyContext || !__DEV__
887+
it('renders an error state if module-style context provider throws in componentWillMount', async () => {
888+
console.log(
889+
gate(flags => {
890+
return {
891+
disableModulePatternComponents: flags.disableModulePatternComponents,
892+
disableLegacyContext: flags.disableLegacyContext,
893+
val: !(
894+
flags.disableModulePatternComponents && flags.disableLegacyContext
895+
),
896+
};
897+
}),
898+
);
887899
function BrokenComponentWillMountWithContext() {
888900
return {
889901
getChildContext() {

packages/react-dom/src/__tests__/ReactLegacyErrorBoundaries-test.internal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,8 @@ describe('ReactLegacyErrorBoundaries', () => {
824824
);
825825
expect(container.firstChild.textContent).toBe('Caught an error: Hello.');
826826
});
827-
// @gate !disableModulePatternComponents && !disableLegacyContext
827+
// @gate !disableModulePatternComponents
828+
// @gate !disableLegacyContext || !__DEV__
828829
it('renders an error state if module-style context provider throws in componentWillMount', () => {
829830
function BrokenComponentWillMountWithContext() {
830831
return {

packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,8 @@ describe('ReactIncrementalErrorHandling', () => {
17561756
);
17571757
});
17581758

1759-
// @gate !(disableModulePatternComponents && disableLegacyContext)
1759+
// @gate !disableModulePatternComponents
1760+
// @gate !disableLegacyContext || !__DEV__
17601761
it('handles error thrown inside getDerivedStateFromProps of a module-style context provider', async () => {
17611762
function Provider() {
17621763
return {

0 commit comments

Comments
 (0)