You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Figured it out. Somehow I ended up with react-scripts as a dependency as well as a devDependency, and when I upgraded from a previous version, only the devDependency upgraded. So I was actually using an older version of Jest, pre-expect.any. D'oh!
Activity
gaearon commentedon Feb 10, 2017
Could this be a new method in Jest 18? We are currently shipping Jest 17.
An update with Jest 18 is coming within a few days.
gaearon commentedon Feb 11, 2017
Seems new in Jest 18. I can confirm it works on master and will work in
react-scripts@0.9.0we're cutting very soon.chrisjcodes commentedon Feb 11, 2017
Awesome thanks @gaearon
gaearon commentedon Feb 11, 2017
Should be available on 0.9.0 we just released.
dangerismycat commentedon Mar 1, 2017
I'm getting this error with
0.9.3, even after nuking and reinstallingnode_modules. Any ideas on what I'm missing?gaearon commentedon Mar 1, 2017
I can’t reproduce this. I added
console.log(typeof expect.any)intosrc/App.test.jsof a newly generated project, and it logs afunction.So if you still have issues, you’ll need to create a project reproducing this.
dangerismycat commentedon Mar 1, 2017
Figured it out. Somehow I ended up with
react-scriptsas a dependency as well as a devDependency, and when I upgraded from a previous version, only the devDependency upgraded. So I was actually using an older version of Jest, pre-expect.any. D'oh!Timer commentedon Mar 1, 2017
@dangerismycat you probably ran something like
npm upgrade react-scripts --save-exact; anyway, glad you figured it out!