javascript - How to Exclude files from jest watch? -


i'm doing bizarre stuff using jest testing i'm writing stuff disk. if use watch flag in jest i'm finding (quite obviously) each time write disk tests re-fire again.

i don't have sort of configuration, , i've taken @ documentation it's not clear me option need using suppress watching particular files. believe can see options exclude code code-coverage, test execution not actual watcher.

in case i've got setup , want suppress results directory:

  • __tests__
    • __snapshots__ (created jest)
    • results (created me , directory exclude)
  • testfile1.js

can shed light on doing this?

from documentation need add modulepathignorepatterns array of string values matched against

modulepathignorepatterns [array] #

(default: []) array of regexp pattern strings matched against module paths before paths considered 'visible' module loader. if given module's path matches of patterns, not require()-able in test environment. these pattern strings match against full path. use string token include path project's root directory prevent accidentally ignoring of files in different environments may have different root directories. example: ['/build/'].

https://facebook.github.io/jest/docs/configuration.html#modulepathignorepatterns-array-string

add config...

modulepathignorepatterns = ["directorynametoignore"] 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -