wojtekmaj / enzyme-adapter-react-17

Unofficial adapter for React 17 for Enzyme.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

method mount() can't used in typescript

ferryal opened this issue · comments

got some issue like this, I try to set mount to global but still facing this issue.

define type global
declare global { function mount(): () => void }

setupTest.ts
Screen Shot 2022-08-09 at 09 36 16

Screen Shot 2022-08-09 at 09 29 59

You assigned mount to global object correctly, that's not your problem.

My best guess is that you installed Jest 28, which no longer uses jsdom test environment as the default.