Skip to content

Commit ad710ad

Browse files
fix: jest globals for browser and node envs (#109)
1 parent 95eae6b commit ad710ad

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

configs/jest.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import globals from "globals";
2+
13
/**
24
* @returns {Promise<Record<string, string>>} config
35
*/
@@ -17,6 +19,13 @@ async function getJestRecommendedConfig() {
1719
return {
1820
...jsdocConfig,
1921
name: "jest/recommended",
22+
languageOptions: {
23+
globals: {
24+
...globals.node,
25+
...globals.browser,
26+
...globals.jest,
27+
},
28+
},
2029
files: [
2130
"**/{tests,test,__tests__}/**/*.?(c|m)[jt]s?(x)",
2231
"**/?(*.)+(spec|test).?(c|m)[jt]s?(x)",

0 commit comments

Comments
 (0)