mirror of
https://github.com/mssoftjp/obsidian-voice-input.git
synced 2026-07-22 06:44:48 +00:00
- Reverted jest.config.js to original state (removed non-existent moduleNameMapper entries)
- Added missing newline to end of jest.config.js (eol-last)
- Enhanced language code normalization to handle regional codes (en-US, zh-CN) via split('-')[0]
- Made generic cleaning patterns safer by requiring colon-terminated patterns
- Applied normalization consistently in both cleaning and error detection methods
Co-authored-by: mssoftjp <115339791+mssoftjp@users.noreply.github.com>
28 lines
742 B
JavaScript
28 lines
742 B
JavaScript
module.exports = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'jsdom',
|
|
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
|
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
transform: {
|
|
'^.+\\.ts$': ['ts-jest', {
|
|
tsconfig: {
|
|
esModuleInterop: true,
|
|
allowSyntheticDefaultImports: true,
|
|
},
|
|
}],
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
|
moduleFileExtensions: ['ts', 'js'],
|
|
collectCoverageFrom: [
|
|
'src/**/*.ts',
|
|
'!src/**/*.d.ts',
|
|
'!src/plugin/index.ts',
|
|
'!src/**/index.ts',
|
|
],
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: ['text', 'lcov', 'html'],
|
|
testTimeout: 10000,
|
|
moduleNameMapper: {
|
|
'^obsidian$': '<rootDir>/tests/mocks/obsidian.ts',
|
|
},
|
|
};
|