From f19fa6164ec05bb6010a8265156411f1e92fb133 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Fri, 28 Feb 2020 14:57:01 -0500 Subject: [PATCH] (fix): if custom jest config path, use its dir as rootDir - that matches Jest's default and means no changes have to be made for the internal jest.config.json to work with `tsdx test` --- src/index.ts | 2 +- test/jest.config.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8fc3b9a70..9f2d8386f 100755 --- a/src/index.ts +++ b/src/index.ts @@ -502,7 +502,7 @@ prog let jestConfig = { ...createJestConfig( relativePath => path.resolve(__dirname, '..', relativePath), - paths.appRoot + opts.config ? path.dirname(opts.config) : paths.appRoot ), ...appPackageJson.jest, }; diff --git a/test/jest.config.json b/test/jest.config.json index 23dff01a8..276ea397c 100644 --- a/test/jest.config.json +++ b/test/jest.config.json @@ -1,6 +1,5 @@ { "testEnvironment": "node", - "rootDir": "./test", "roots": ["/tests"], "collectCoverageFrom": ["**/*.js"], "transform": {