const { pathsToModuleNameMapper } = require("ts-jest"); const { compilerOptions } = require("./tsconfig.json"); const paths = compilerOptions.paths ? compilerOptions.paths : {}; /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ module.exports = { preset: "ts-jest", rootDir: "./", setupFilesAfterEnv: ["/test/jest.setup.ts"], testPathIgnorePatterns: [ "/node_modules/", "/example/", "/dist/", ], moduleNameMapper: { ...pathsToModuleNameMapper(paths, { prefix: "/" }), "\\.css$": "identity-obj-proxy", }, displayName: "core", transform: { "^.+\\.svg$": "/test/svgTransform.ts", "^.+\\.tsx?$": [ "ts-jest", { tsconfig: "/tsconfig.test.json", diagnostics: { ignoreCodes: [2578], }, }, ], }, coveragePathIgnorePatterns: [ "/src/index.ts", "/src/interfaces/", ], testEnvironment: "jsdom", };