-
Notifications
You must be signed in to change notification settings - Fork 33
/
audio-context-constructor.js
43 lines (33 loc) · 1.35 KB
/
audio-context-constructor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
describe('audioContextConstructor', () => {
let audioContext;
afterEach(() => audioContext.close());
beforeEach(() => {
audioContext = new AudioContext();
});
describe('audioWorklet', () => {
describe('addModule()', () => {
describe('with a module which contains an import statement', () => {
// bug #176
it('should throw an error', function (done) {
this.timeout(10000);
audioContext.audioWorklet.addModule('base/test/fixtures/gibberish-processor.js').catch((err) => {
expect(err.code).to.equal(20);
expect(err.name).to.equal('AbortError');
done();
});
});
});
describe('with an unparsable module', () => {
// bug #177
it('should return a promise which rejects an AbortError', function (done) {
this.timeout(10000);
audioContext.audioWorklet.addModule('base/test/fixtures/unparsable-processor.xs').catch((err) => {
expect(err.code).to.equal(20);
expect(err.name).to.equal('AbortError');
done();
});
});
});
});
});
});