From 2db412e10cf223b3ab5b02264ce79b4cec1bdd9c Mon Sep 17 00:00:00 2001 From: lionelv Date: Thu, 18 Apr 2024 15:26:30 +0200 Subject: [PATCH] test: test deregister() --- test/integration/module.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration/module.js b/test/integration/module.js index 01fd976d..84e49c9e 100644 --- a/test/integration/module.js +++ b/test/integration/module.js @@ -1,5 +1,5 @@ import { AudioContext, ConstantSourceNode } from 'standardized-audio-context'; -import { MediaRecorder, isSupported, register } from '../../src/module'; +import { MediaRecorder, deregister, isSupported, register } from '../../src/module'; import { connect } from 'extendable-media-recorder-wav-encoder'; import { createMediaStreamAudioDestinationNode } from '../helpers/create-media-stream-audio-destination-node'; import { createMediaStreamWithAudioTrack } from '../helpers/create-media-stream-with-audio-track'; @@ -31,12 +31,18 @@ describe('module', () => { // eslint-disable-next-line no-undef if (!process.env.TARGET || !process.env.TARGET.endsWith('-unsupported')) { describe('MediaRecorder', () => { - before(async () => { - const port = await connect(); + let port; + + beforeEach(async () => { + port = await connect(); await register(port); }); + afterEach(async () => { + await deregister(port); + }); + // eslint-disable-next-line no-undef const channelCounts = process.env.CI && /Chrome/.test(navigator.userAgent) ? [2] : [1, 2]; const mimeTypes = [