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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -