23 lines
648 B
JavaScript
23 lines
648 B
JavaScript
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: "./",
|
|
testEnvironment: "node",
|
|
moduleNameMapper: {
|
|
...pathsToModuleNameMapper(paths, { prefix: "<rootDir>/" }),
|
|
"^.+\\.tsx?$": [
|
|
"ts-jest",
|
|
{
|
|
tsconfig: "<rootDir>/tsconfig.test.json",
|
|
},
|
|
],
|
|
},
|
|
testEnvironment: "jsdom",
|
|
displayName: "live-previews",
|
|
};
|