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

View File

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