Skip to content

Commit

Permalink
Fix setupEnzyme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Q committed Apr 11, 2019
1 parent 0d90202 commit 7da5537
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/setupEnzyme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { hasAnyDep } = require('./utils')

const setupEnzyme = () => {
const { hasAnyDep } = require('./utils')

if (!hasAnyDep('enzyme')) return

const Enzyme = require('enzyme')
let adapterVersion

Expand All @@ -17,10 +18,10 @@ const setupEnzyme = () => {
const Adapter = require(`enzyme-adapter-react-${adapterVersion}`)

Enzyme.configure({ adapter: new Adapter() })
}

afterEach(() => {
document.body.innerHTML = ''
})
afterEach(() => {
document.body.innerHTML = ''
})
}

module.exports = setupEnzyme

0 comments on commit 7da5537

Please sign in to comment.