-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove ts-jest to use fully swc also for ts paths
- Loading branch information
Albert Hernandez Pellicer
committed
Jan 20, 2024
1 parent
98c7e05
commit b8e8b50
Showing
3 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import type { JestConfigWithTsJest } from "ts-jest"; | ||
import { pathsToModuleNameMapper } from "ts-jest"; | ||
import fs from "fs-extra"; | ||
import type { Config } from "jest"; | ||
|
||
import { compilerOptions } from "./tsconfig.json"; | ||
const swcConfig = JSON.parse(fs.readFileSync(`${__dirname}/.swcrc`, "utf-8")); | ||
|
||
const config: JestConfigWithTsJest = { | ||
const config: Config = { | ||
transform: { | ||
"^.+\\.(t|j)s$": "@swc/jest", | ||
"^.+\\.(t|j)s$": ["@swc/jest", swcConfig], | ||
}, | ||
testEnvironment: "node", | ||
cacheDirectory: ".tmp/jestCache", | ||
collectCoverage: true, | ||
collectCoverageFrom: ["src/**/*.ts"], | ||
setupFiles: ["<rootDir>.jest/set-env-vars.ts"], | ||
clearMocks: true, | ||
modulePaths: [compilerOptions.baseUrl], | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths), | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters