@storm-software/testing-tools
Version:
A package containing various testing tools used by Storm workspaces to drive unit and e2e testing.
46 lines (45 loc) • 957 B
JavaScript
// src/jest/declare-preset.ts
import nxPreset from "@nx/jest/preset";
import defu from "defu";
function declarePreset(config = {}) {
return defu(
config,
{
collectCoverage: true,
testTimeout: 3e4,
clearMocks: true,
testMatch: ["**/+(*.)+(spec|test).+(ts|js)?(x)"],
transform: {
"^.+\\.(ts|js|mts|mjs|cts|cjs|html)$": [
"ts-jest",
{ tsconfig: "<rootDir>/tsconfig.spec.json" }
]
},
snapshotFormat: {
printBasicPrototype: false
},
globals: {
"ts-jest": {
isolatedModules: true,
diagnostics: {
exclude: ["**"]
}
}
},
moduleFileExtensions: ["ts", "js", "html"],
coverageReporters: [
"json",
"lcov",
"text",
"clover",
"text-summary",
"html"
],
maxWorkers: 1
},
nxPreset ?? {}
);
}
export {
declarePreset
};