From a08ff4b2f2af7fe41d6139880ade2acbbb896fc3 Mon Sep 17 00:00:00 2001 From: Biki-das Date: Sat, 29 Jan 2022 23:33:18 +0530 Subject: [PATCH] Added allowing for tests in node modules --- docs/Configuration.md | 2 ++ packages/jest-config/src/ValidConfig.ts | 1 + packages/jest-haste-map/src/types.ts | 1 + packages/jest-types/src/Config.ts | 2 ++ 4 files changed, 6 insertions(+) diff --git a/docs/Configuration.md b/docs/Configuration.md index db32780483b3..3a4c9104dd3b 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -508,6 +508,8 @@ type HasteConfig = { /** All platforms to target, e.g ['ios', 'android']. */ platforms?: Array; /** Whether to throw on error on module collision. */ + // Whether to search for tests in node_modules. + retainAllFiles?: boolean; throwOnModuleCollision?: boolean; /** Custom HasteMap module */ hasteMapModulePath?: string; diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index 932e7737d904..11544db86848 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -64,6 +64,7 @@ const initialOptions: Config.InitialOptions = { hasteImplModulePath: '/haste_impl.js', hasteMapModulePath: '', platforms: ['ios', 'android'], + retainAllFiles: false, throwOnModuleCollision: false, }, injectGlobals: true, diff --git a/packages/jest-haste-map/src/types.ts b/packages/jest-haste-map/src/types.ts index 335a61cb56a7..e73204d358eb 100644 --- a/packages/jest-haste-map/src/types.ts +++ b/packages/jest-haste-map/src/types.ts @@ -58,6 +58,7 @@ export type WorkerMessage = { rootDir: string; filePath: string; hasteImplModulePath?: string; + retainAllFiles?: boolean; }; export type WorkerMetadata = { diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index d94e4296b5f5..3cba29442998 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -37,6 +37,8 @@ export type HasteConfig = { /** Whether to throw on error on module collision. */ throwOnModuleCollision?: boolean; /** Custom HasteMap module */ + /** Whether to search for tests in node_modules. */ + retainAllFiles?: boolean; hasteMapModulePath?: string; };