Skip to content

Commit

Permalink
(deps): use jest-without-globals to import jest globals
Browse files Browse the repository at this point in the history
- no more globals used in tests!
  • Loading branch information
agilgur5 committed Feb 10, 2022
1 parent 06347a3 commit ac8c952
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 0 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module.exports = {
moduleNameMapper: {
// allow importing of Jest as an ES Module (https://github.com/facebook/jest/pull/7571#issuecomment-498634094)
'^jest$': '<rootDir>/test/config/jest-export.js'
},
setupFilesAfterEnv: [
// configure enzyme w/ react adapter
'<rootDir>/test/config/configure-enzyme.js',
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"css-loader": "^0.24.0",
"enzyme": "^3.10.0",
"jest": "^24.8.0",
"jest-without-globals": "^0.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hot-loader": "^1.2.7",
Expand Down
4 changes: 0 additions & 4 deletions test/config/jest-export.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import jest, { describe, it, test, expect } from 'jest'
import { jest, describe, it, test, expect } from 'jest-without-globals'
import { mount } from 'enzyme'
import React from 'react'

Expand Down

0 comments on commit ac8c952

Please sign in to comment.