Skip to content

Commit

Permalink
Fix gates for real this time
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Feb 9, 2024
1 parent c1b9f9c commit 5405fae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,20 @@ describe('ReactErrorBoundaries', () => {
expect(container.firstChild.textContent).toBe('Caught an error: Hello.');
});

// @gate !(disableModulePatternComponents && disableLegacyContext)
it('renders an error state if module-style context provider throws in componentWillMount', () => {
// @gate !disableModulePatternComponents
// @gate !disableLegacyContext || !__DEV__
it('renders an error state if module-style context provider throws in componentWillMount', async () => {
console.log(
gate(flags => {
return {
disableModulePatternComponents: flags.disableModulePatternComponents,
disableLegacyContext: flags.disableLegacyContext,
val: !(
flags.disableModulePatternComponents && flags.disableLegacyContext
),
};
}),
);
function BrokenComponentWillMountWithContext() {
return {
getChildContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ describe('ReactLegacyErrorBoundaries', () => {
);
expect(container.firstChild.textContent).toBe('Caught an error: Hello.');
});
// @gate !disableModulePatternComponents && !disableLegacyContext
// @gate !disableModulePatternComponents
// @gate !disableLegacyContext || !__DEV__
it('renders an error state if module-style context provider throws in componentWillMount', () => {
function BrokenComponentWillMountWithContext() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,8 @@ describe('ReactIncrementalErrorHandling', () => {
);
});

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

0 comments on commit 5405fae

Please sign in to comment.