chore: Enforce a few house rules via eslint (#2539)
This commit is contained in:
committed by
dermotduffy
parent
5572ec728e
commit
921d45e577
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user