Skip to content

Commit 5f97535

Browse files
lifeartclaude
andcommitted
Fix noise test teardown: stub AudioContext needs close()
The service's willDestroy() closes the context on teardown; the running context stub lacked close(), so the test rejected with 'this.context.close is not a function'. Mirrors the stub used in the playback-rate tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8fb4e5 commit 5f97535

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

frontend/tests/unit/services/audio-test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,13 @@ module('Unit | Service | audio', function (hooks) {
336336
this.owner.register('service:audio', TestAudioService);
337337
const service = this.owner.lookup('service:audio');
338338
// A running context is the post-restart case; the suspended-context
339-
// resume is production-only (guarded by !isTesting()).
340-
service.context = { state: 'running', resume: () => Promise.resolve() };
339+
// resume is production-only (guarded by !isTesting()). close() is needed
340+
// because the service's willDestroy() closes the context on teardown.
341+
service.context = {
342+
state: 'running',
343+
resume: () => Promise.resolve(),
344+
close: () => Promise.resolve(),
345+
};
341346

342347
const instance = service.startNoiseTask.perform();
343348
// The task loops on timeout(6000) after starting; cancel once started.

0 commit comments

Comments
 (0)