jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
886 stars 118 forks source link

There are obsolete instructions in the readme.md #88

Open janhesters opened 5 years ago

janhesters commented 5 years ago

I'm using Create-React-App. After following the docs and adding:

"jest": {
  "setupTestFrameworkScriptFile": "<rootDir>/src/setupTests.js"
}

I received the error message:

We detected setupTestFrameworkScriptFile in your package.json.

Remove it from Jest configuration, and put the initialization code in src/setupTests.js.
This file will be loaded automatically.

After I removed the key from Jest, all tests worked.

jefflau commented 5 years ago

Thanks for reporting this. PR is welcome for this. If not I will try and find some time in the next week or so

jefflau commented 5 years ago

Ah I just realised what happened here. So this is only if you are ejecting. I think the docs are a little unclear here so I'll update it so it is clear this is only for ejecting

janhesters commented 5 years ago

Perfect