Skip to content

Commit

Permalink
Fix tests under Node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed May 17, 2023
1 parent 91c7b85 commit a0abe75
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
14 changes: 12 additions & 2 deletions packages/mui-material-next/src/Tabs/Tabs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,21 @@ describe('<Tabs />', () => {

nodeEnv = process.env.NODE_ENV;
// We can't use a regular assignment, because it causes a syntax error in Karma
Object.defineProperty(process.env, 'NODE_ENV', { value: 'development' });
Object.defineProperty(process.env, 'NODE_ENV', {
value: 'development',
configurable: true,
writable: true,
enumerable: true,
});
});

after(() => {
Object.defineProperty(process.env, 'NODE_ENV', { value: nodeEnv });
Object.defineProperty(process.env, 'NODE_ENV', {
value: nodeEnv,
configurable: true,
writable: true,
enumerable: true,
});
});

it('should warn if a Tab has display: none', () => {
Expand Down
14 changes: 12 additions & 2 deletions packages/mui-material/src/Tabs/Tabs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,21 @@ describe('<Tabs />', () => {

nodeEnv = process.env.NODE_ENV;
// We can't use a regular assignment, because it causes a syntax error in Karma
Object.defineProperty(process.env, 'NODE_ENV', { value: 'development' });
Object.defineProperty(process.env, 'NODE_ENV', {
value: 'development',
configurable: true,
writable: true,
enumerable: true,
});
});

after(() => {
Object.defineProperty(process.env, 'NODE_ENV', { value: nodeEnv });
Object.defineProperty(process.env, 'NODE_ENV', {
value: nodeEnv,
configurable: true,
writable: true,
enumerable: true,
});
});

it('should warn if a `Tab` has display: none', function test() {
Expand Down

0 comments on commit a0abe75

Please sign in to comment.