Skip to content

Commit ac8c952

Browse files
committed
(deps): use jest-without-globals to import jest globals
- no more globals used in tests!
1 parent 06347a3 commit ac8c952

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

jest.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
module.exports = {
2-
moduleNameMapper: {
3-
// allow importing of Jest as an ES Module (https://github.com/facebook/jest/pull/7571#issuecomment-498634094)
4-
'^jest$': '<rootDir>/test/config/jest-export.js'
5-
},
62
setupFilesAfterEnv: [
73
// configure enzyme w/ react adapter
84
'<rootDir>/test/config/configure-enzyme.js',

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"css-loader": "^0.24.0",
6868
"enzyme": "^3.10.0",
6969
"jest": "^24.8.0",
70+
"jest-without-globals": "^0.0.2",
7071
"react": "^17.0.2",
7172
"react-dom": "^17.0.2",
7273
"react-hot-loader": "^1.2.7",

test/config/jest-export.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import jest, { describe, it, test, expect } from 'jest'
1+
import { jest, describe, it, test, expect } from 'jest-without-globals'
22
import { mount } from 'enzyme'
33
import React from 'react'
44

0 commit comments

Comments
 (0)