jamiefdhurst_obsidian-inbox.../jest.config.js
Jamie Hurst 3b5bb7aa7d
chore(test): replace jest-environment-obsidian with jsdom for Jest 30.4.x compatibility
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.
2026-06-02 11:44:51 +01:00

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/'],
};