jeudi 13 août 2020

how to get Jest --watch to run on changes to JSON/YAML files?

I'm running some jest tests with --watch that depend on data fixtures. I want the watch run to trigger when I edit my data files, not just the code. I've added the following to my package.json specifically adding yaml for moduleFileExtensions but still not having any luck. Based on: https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring

Is there a setting I could make to the package.json to see if it's even getting picked up at all? I guess next step is to try with a .js config, throw some errors in and see if I'm barking up the wrong tree!

  "jest": {
    "verbose": true,
    "modulePaths": [
      "cdn",
      "src"
    ],
    "moduleFileExtensions": [
      "js",
      "json",
      "jsx",
      "ts",
      "tsx",
      "yaml"
    ]

Aucun commentaire:

Enregistrer un commentaire