z-fab_agentmd-obsidian/tests/setup.ts
Fabricio Zillig d5c2fc0162 chore: pass Obsidian plugin lint and bump to 0.3.1
- Add eslint (typescript-eslint + eslint-plugin-obsidianmd) with a lint script
  and run it in the release workflow
- Replace direct element.style assignments with CSS utility classes
- Use window timers, activeDocument, and FileSystemAdapter for popout/window
  compatibility and to drop unsafe any casts
- Use Notice.messageEl (was deprecated noticeEl) and await revealLeaf;
  bump minAppVersion to 1.8.7 accordingly
- Replace electron require() with a typed import + ambient module declaration
- Mark fire-and-forget promises with void; tidy command name
- Provide window in the test setup so window-timer code runs under Node
2026-06-05 22:50:24 -03:00

7 lines
408 B
TypeScript

// Plugin code uses `window.setTimeout`/`clearTimeout`/`setInterval` for popout
// window compatibility (required by the Obsidian review). The test runner uses
// the Node environment, which has no `window`, so alias it to globalThis where
// the Node timer globals live.
if (typeof (globalThis as { window?: unknown }).window === "undefined") {
(globalThis as { window?: unknown }).window = globalThis;
}