From 623b4f99a074485142bdb361634e8695c3d0b676 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Thu, 10 Jan 2019 15:45:11 +0100 Subject: [PATCH] ignore test file paths inside node_modules because it's default Jest behaviour https://jestjs.io/docs/en/22.2/configuration#testpathignorepatterns-arra y-string --- src/test-files-finder.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test-files-finder.ts b/src/test-files-finder.ts index dfa05ed..59b1834 100644 --- a/src/test-files-finder.ts +++ b/src/test-files-finder.ts @@ -7,6 +7,11 @@ export class TestFilesFinder { public static allTestFiles(): TestFile[] { return glob .sync(EnvConfig.testFilePattern) + .filter((testFilePath: string) => { + // ignore test file paths inside node_modules because it's default Jest behaviour + // https://jestjs.io/docs/en/22.2/configuration#testpathignorepatterns-array-string + return !testFilePath.match(/node_modules/); + }) .map((testFilePath: string) => ({ path: testFilePath })); } }