mirror of
https://github.com/jamiefdhurst/obsidian-inbox-organiser.git
synced 2026-07-22 05:31:23 +00:00
jest-environment-obsidian@0.0.1 bundles jest-mock@29 internally, which lacks the clearMocksOnScope method added in Jest 30.4.x. Switches to jest-environment-jsdom and adds a setup file providing the Obsidian DOM globals and prototype extensions that the environment previously injected.
22 lines
606 B
JavaScript
22 lines
606 B
JavaScript
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
module.exports = {
|
|
testEnvironment: 'jest-environment-jsdom',
|
|
setupFiles: ['./src/__tests__/setup.ts'],
|
|
verbose: true,
|
|
preset: 'ts-jest',
|
|
transform: {
|
|
'^.+\\.ts$': [
|
|
'ts-jest',
|
|
{
|
|
tsconfig: {
|
|
module: 'CommonJS',
|
|
verbatimModuleSyntax: false,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
moduleFileExtensions: ['js', 'd.ts', 'ts'],
|
|
coverageReporters: ['html', 'text', 'cobertura'],
|
|
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!<rootDir>/node_modules/'],
|
|
};
|