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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -