From 639992c542acde7626f87bd63132c6c802f8b379 Mon Sep 17 00:00:00 2001 From: zzhhaa Date: Wed, 11 Dec 2024 13:16:17 +0000 Subject: [PATCH] config: update jest config for debugger --- jest.config.ts | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index b4c41959..faf04d39 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -84,16 +84,16 @@ const config: Config = { // ], // An array of file extensions your modules use - // moduleFileExtensions: [ - // "js", - // "mjs", - // "cjs", - // "jsx", - // "ts", - // "tsx", - // "json", - // "node" - // ], + moduleFileExtensions: [ + "js", + "mjs", + "cjs", + "jsx", + "ts", + "tsx", + "json", + "node" + ], // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module // moduleNameMapper: {}, @@ -132,9 +132,10 @@ const config: Config = { // rootDir: undefined, // A list of paths to directories that Jest should use to search for files in - // roots: [ - // "" - // ], + roots: [ + "" + ], + modulePaths: [""], // Allows you to use a custom runner instead of Jest's default test runner // runner: "jest-runner", @@ -161,10 +162,7 @@ const config: Config = { // testLocationInResults: false, // The glob patterns Jest uses to detect test files - // testMatch: [ - // "**/__tests__/**/*.[jt]s?(x)", - // "**/?(*.)+(spec|test).[tj]s?(x)" - // ], + testMatch: ["**/*.test.ts"], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // testPathIgnorePatterns: [ @@ -181,7 +179,11 @@ const config: Config = { // testRunner: "jest-circus/runner", // A map from regular expressions to paths to transformers - // transform: undefined, + transform: { + "^.+\\.tsx?$": ["ts-jest", { + tsconfig: "tsconfig.json" + }] + }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation // transformIgnorePatterns: [