Skip to content

Commit b078f6a

Browse files
fix: flag logic, test
1 parent 7ab6fdd commit b078f6a

File tree

1 file changed

+2
-2
lines changed
  • packages/@lwc/integration-karma/test/component/LightningElement

1 file changed

+2
-2
lines changed

packages/@lwc/integration-karma/test/component/LightningElement/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ it("[W-6981076] shouldn't throw when a component with an invalid child in unmoun
8282
});
8383

8484
it('should fail when the constructor returns something other than LightningElement when DISABLE_LIGHTNING_CONSTRUCTOR_CHECK is true', () => {
85-
setFeatureFlagForTest('DISABLE_LIGHTNING_CONSTRUCTOR_CHECK', true);
8685
expect(() => {
8786
createElement('x-returning-bad', { is: ReturningBad });
8887
}).toThrowError(
8988
TypeError,
9089
'Invalid component constructor, the class should extend LightningElement.'
9190
);
92-
setFeatureFlagForTest('DISABLE_LIGHTNING_CONSTRUCTOR_CHECK', false);
9391
});
9492

9593
it('should succeed when the constructor returns something other than LightningElement when DISABLE_LIGHTNING_CONSTRUCTOR_CHECK is falsy', () => {
94+
setFeatureFlagForTest('DISABLE_LIGHTNING_CONSTRUCTOR_CHECK', true);
9695
expect(() => {
9796
createElement('x-returning-bad', { is: ReturningBad });
9897
}).not.toThrow();
98+
setFeatureFlagForTest('DISABLE_LIGHTNING_CONSTRUCTOR_CHECK', false);
9999
});

0 commit comments

Comments
 (0)