1 | import { JCReverb } from "./JCReverb.js";
|
2 | import { BasicTests } from "../../test/helper/Basic.js";
|
3 | import { EffectTests } from "../../test/helper/EffectTests.js";
|
4 | import { expect } from "chai";
|
5 | import { CompareToFile } from "../../test/helper/CompareToFile.js";
|
6 | import { Noise } from "../source/Noise.js";
|
7 |
|
8 | describe("JCReverb", () => {
|
9 | BasicTests(JCReverb);
|
10 | EffectTests(JCReverb);
|
11 |
|
12 | it("matches a file", () => {
|
13 | return CompareToFile(
|
14 | () => {
|
15 | const reverb = new JCReverb().toDestination();
|
16 | const noise = new Noise().connect(reverb);
|
17 | noise.start(0).stop(0.1);
|
18 | },
|
19 | "jcReverb.wav",
|
20 | 0.2
|
21 | );
|
22 | });
|
23 |
|
24 | context("API", () => {
|
25 | it("can pass in options in the constructor", () => {
|
26 | const reverb = new JCReverb({
|
27 | roomSize: 0.2,
|
28 | });
|
29 | expect(reverb.roomSize.value).to.be.closeTo(0.2, 0.01);
|
30 | reverb.dispose();
|
31 | });
|
32 |
|
33 | it("can get/set the options", () => {
|
34 | const reverb = new JCReverb();
|
35 | reverb.set({
|
36 | roomSize: 0.23,
|
37 | });
|
38 | expect(reverb.get().roomSize).to.be.closeTo(0.23, 0.01);
|
39 | reverb.dispose();
|
40 | });
|
41 | });
|
42 | });
|