regex - Jest to only run certain suffix -


i trying configure jest in project. run tests in directory __tests__ have -test or -spec suffix

i tried (/__tests__/.*|\\.(-test|-spec))\\.(ts|tsx|js)$ seems run files under __test__ directory

the fix simple i'm not regex

if recall correctly, test regex little bit weird because have double escape backslashes regexes in json strings.

in jest 19+, can using testmatch instead.

{   ...   testmatch: "**/__tests__/+([a-za-z0-9_-])-@(test|spec).@(js|ts|tsx)"   ... } 

Comments

Popular posts from this blog

javascript - Knockout pushing observable and computed data to an observable array -

'hasOwnProperty' in javascript -

Trouble making a JSON string -