chore: Enforce a few house rules via eslint (#2539)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent 5572ec728e
commit 921d45e577
100 changed files with 479 additions and 295 deletions
@@ -10,13 +10,13 @@ interface AudioMocks {
}
// Uses real jsdom HTMLAudioElement instances and only stubs the parts jsdom
// can't fulfil (`play()` / `pause()` — no audio backend). Tests then exercise
// observable behaviour: registered listeners fire via `dispatchEvent`,
// property writes round-trip on the element, etc.
// can't fulfil (`play()` / `pause()` -- no audio backend). Tests then exercise
// observable behaviour: registered listeners fire via `dispatchEvent`, property
// writes round-trip on the element, etc.
//
// Called once at module load. The `beforeEach`/`afterEach` calls inside this
// helper register Vitest hooks at the file level — Vitest picks them up just
// as if they had been written at the top of the file — so every test in the
// helper register Vitest hooks at the file level -- Vitest picks them up just
// as if they had been written at the top of the file -- so every test in the
// file gets fresh mocks installed/torn down automatically.
const useAudioElementMocks = (): AudioMocks => {
const handle = { instances: [] as HTMLAudioElement[] } as AudioMocks;