Skip to content

Commit

Permalink
[test] Fix JSDOM detection in tests (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak authored and atomiks committed Oct 30, 2024
1 parent 8ee57f8 commit df1ba95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default mergeConfig(
enabled: false,
name: 'node',
},
env: {
VITEST_ENV: 'node',
},
},
}),
);
2 changes: 1 addition & 1 deletion test/setupVitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ globalThis.after = afterAll;
// @ts-ignore
globalThis.vi = vi;

const isVitestJsdom = process.env.MUI_JSDOM === 'true';
const isVitestJsdom = process.env.VITEST_ENV === 'jsdom';

// Only necessary when not in browser mode.
if (isVitestJsdom) {
Expand Down

0 comments on commit df1ba95

Please sign in to comment.