Closed greglobinski closed 6 years ago
@greglobinski I am not sure about the creation of the project - @Tuhaj could you please share a few words about it?
on my side it is working perfectly clean when using npm run test:watch
:(
@kgajowy Maybe that's because I'm on Windows. I will investigate it further, just wanted to now first why @Tuhaj changed the default settings of create-react-app
, what is the reason.
I have found the workaround, I've added jest-cli
to devDependncies
"devDependencies": {
"jest": "^22.4.3",
"jest-cli": "^23.1.0",
...
and the tests run with 'locally' installed jest
and without the error.
It would be nice to add it to the repo's package.json, but I have no idea if it would not harm you.
@greglobinski I tried to install jest-cli on my side, but:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for inotify@1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: darwin
npm ERR! notsup Actual Arch: x64
The test
script command was used from the standard setting, so I think it's unfortunately platform specific. The command you mentioned, doesn't work on my environment too.
@Tuhaj Thank you for the feedback, I pulled out the jest-cli
workaround. It was not so great :) But I found different solution. On a daily basis I use yarn
, but I gave npm
a try. I removed npm_modules
and installed everything with npm install
instead yarn install
and guess what... it works :)
The
test
command fails with the error:The problem is described on https://stackoverflow.com/questions/48149004/typeerror-environment-setup-is-not-a-function-in-react-testing
Why did we replace the original the
create-react-app
'sjest
setup? When I back totest
command works, as it should in--watch
mode