陈帅 6 years ago
parent
commit
32cc540b15
3 changed files with 3 additions and 0 deletions
  1. 1 0
      jest.config.js
  2. 1 0
      package.json
  3. 1 0
      tests/setupTests.js

+ 1 - 0
jest.config.js

@@ -1,6 +1,7 @@
 module.exports = {
   testURL: 'http://localhost:8000',
   preset: 'jest-puppeteer',
+  extraSetupFiles: ['./tests/setupTests.js'],
   globals: {
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false, // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
   },

+ 1 - 0
package.json

@@ -107,6 +107,7 @@
     "gh-pages": "^2.0.1",
     "husky": "^1.3.1",
     "jest-puppeteer": "^4.1.0",
+    "jsdom-global": "^3.0.2",
     "less": "^3.9.0",
     "lint-staged": "^8.1.1",
     "merge-umi-mock-data": "^1.0.4",

+ 1 - 0
tests/setupTests.js

@@ -0,0 +1 @@
+import 'jsdom-global/register';