Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI Jest Preset react-native not found

I'm having a react-native app.

Today I added unit tests with Jest and I hooked up Travis CI. When I run the tests locally, everything is fine. but when they run in Travis, I get this error:

Validation Error: Preset react-native not found.

Thanks.

like image 594
shabenda Avatar asked Jul 15 '17 11:07

shabenda


1 Answers

I had this issue and even tried it in a fresh project.

enter image description here

I fixed it by removing

"jest": {
    "preset": "react-native"
}

from my package.json.

Doing this enabled me to run npm run test or jest to run jest.

My guess (i could be wrong) is newer versions of jest wont need that config in the packages.json file anymore.

like image 125
garrettmac Avatar answered Oct 13 '22 02:10

garrettmac