mirror of
https://github.com/banisterious/obsidian-charted-roots.git
synced 2026-07-22 06:40:24 +00:00
Blanket migration of every remaining setTimeout / setInterval / clearTimeout / clearInterval call across src/ and main.ts to the activeWindow.* form. Closes the rest of the 152-warning prefer-active-window-timers backlog from the 0.2.9 ESLint upgrade. Vitest gets a new tests/setup.ts that points activeWindow at globalThis so source code that runs under both Obsidian and the unit-test runtime resolves to the host's setTimeout in tests.
23 lines
554 B
TypeScript
23 lines
554 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import path from 'node:path';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
include: ['tests/**/*.test.ts'],
|
|
setupFiles: ['tests/setup.ts'],
|
|
environment: 'node',
|
|
globals: false,
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html'],
|
|
include: ['src/**/*.ts'],
|
|
exclude: ['src/**/*.test.ts', 'src/**/types.ts']
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
// Intercept `import { ... } from 'obsidian'` in tests and route to mock.
|
|
obsidian: path.resolve(__dirname, 'tests/mocks/obsidian.ts')
|
|
}
|
|
}
|
|
});
|