test: configure jest in typescript

This commit is contained in:
Amin Yahyaabadi 2023-07-24 13:20:23 -07:00
parent f0d23edbf1
commit 9fabf05a6b
2 changed files with 9 additions and 9 deletions

View File

@ -1,16 +1,15 @@
/** @typedef {import("jest")} jestConfig */
const jestConfig = {
import type { JestConfigWithTsJest } from "ts-jest"
const jestConfig: JestConfigWithTsJest = {
testMatch: ["**/*.test.ts"],
testEnvironment: "node",
// transform configurations
preset: "ts-jest/presets/js-with-ts-esm",
extensionsToTreatAsEsm: [".ts"],
transformIgnorePatterns: [], // transform everything
testEnvironment: "node",
testMatch: ["**/*.test.ts"],
testPathIgnorePatterns: ["<rootDir>/src/python/setup-python/"],
// tsconfig
transformIgnorePatterns: [], // transform node_modules
transform: {
"^.+\\.tsx?$": [
"ts-jest",
/** @type {import("ts-jest")} */
{
importHelpers: true,
useESM: true,

View File

@ -32,6 +32,7 @@
"./src",
"dev/scripts",
"packages/untildify-user/untildify.ts",
"dev/docker/__tests__/generate-docker-tests.mjs"
"dev/docker/__tests__/generate-docker-tests.mjs",
"./jest.config.ts"
]
}