mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-26 19:43:12 +00:00
aaf880c925
* WIP moving tests to web-test-runner * updating thresholds * Adding file extensions * Testing integrations * linting * fixing dep * moving back to root dir * prettier all of the files * updating eslint rules to use with prettier * remove import package * moving tsignore around * removing unneeded ignores * all tests run on puppeteer, no need for testing guards * linting * import type syntax * cleaning up * Update package.json
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { PingPongDelay } from "./PingPongDelay.js";
|
|
import { BasicTests } from "../../test/helper/Basic.js";
|
|
import { EffectTests } from "../../test/helper/EffectTests.js";
|
|
import { expect } from "chai";
|
|
import { CompareToFile } from "../../test/helper/CompareToFile.js";
|
|
import { Oscillator } from "../source/oscillator/Oscillator.js";
|
|
|
|
describe("PingPongDelay", () => {
|
|
BasicTests(PingPongDelay);
|
|
EffectTests(PingPongDelay, 0.01);
|
|
|
|
it("matches a file", () => {
|
|
return CompareToFile(
|
|
() => {
|
|
const delay = new PingPongDelay(0.2, 0.8).toDestination();
|
|
const pulse = new Oscillator().connect(delay);
|
|
pulse.start(0).stop(0.1);
|
|
},
|
|
"pingPongDelay.wav",
|
|
0.2
|
|
);
|
|
});
|
|
|
|
context("API", () => {
|
|
it("can pass in options in the constructor", () => {
|
|
const pingPong = new PingPongDelay({
|
|
delayTime: 0.2,
|
|
});
|
|
expect(pingPong.delayTime.value).to.be.closeTo(0.2, 0.01);
|
|
pingPong.dispose();
|
|
});
|
|
|
|
it("can get/set the options", () => {
|
|
const pingPong = new PingPongDelay();
|
|
pingPong.set({
|
|
delayTime: 0.21,
|
|
});
|
|
expect(pingPong.get().delayTime).to.be.closeTo(0.21, 0.01);
|
|
pingPong.dispose();
|
|
});
|
|
});
|
|
});
|