Jest ignoring package.json specifications

1

I am implementing tests in my web application on react with the jest. Since it was started with the "create-react-app" it was easy to configure the environment. But for some reason the jest seems to ignore package.json specifications ...

{
  "jest": {
    "collectCoverageFrom":[
      "src/**/*.{js,sx}",
      "!src/index.js",
      "!src/BooksAPI.js"
    ],
    "snapshotSerializers": ["enzyme-to-json/serializer"]
  }
...
}

Although I have added to the collectCoverageFrom to ignore the index files and BooksAPI they persist when I run tests with the --coverage flag active. In addition, although I specifically state that I want to use the 'enzyme-to-json' package serializer, the snapshot remains the jest pattern.

DoesanyoneknowwhatIcouldpossiblybedoingwrong?IalreadycheckedthetypingcarefullyandIthinkitiscorrect.Followtheprojectlinkifnecessary: link

    
asked by anonymous 10.09.2017 / 21:40

1 answer

0

It seems like a problem in react-scripts itself. The error occurred when using version 0.9.x of react-scripts. While updating to version 1.0.13 the problem has disappeared.

    
16.09.2017 / 21:53