Tone.js/Tone/signal/GainToAudio.test.ts
Yotam Mann aaf880c925
Using web-test-runner for tests, updating import paths (#1242)
* 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
2024-05-03 14:31:14 -04:00

39 lines
1 KiB
TypeScript

import { BasicTests } from "../../test/helper/Basic.js";
import { connectFrom, connectTo } from "../../test/helper/Connect.js";
import { ConstantOutput } from "../../test/helper/ConstantOutput.js";
import { Zero } from "./Zero.js";
import { GainToAudio } from "./GainToAudio.js";
import { Signal } from "./Signal.js";
describe("GainToAudio", () => {
BasicTests(GainToAudio);
context("Gain To Audio", () => {
it("outputs 0 for an input value of 0.5", () => {
return ConstantOutput(() => {
const sig = new Signal(0.5);
const g2a = new GainToAudio();
sig.connect(g2a);
g2a.toDestination();
}, 0);
});
it("outputs 1 for an input value of 1", () => {
return ConstantOutput(() => {
const sig = new Signal(1);
const g2a = new GainToAudio();
sig.connect(g2a);
g2a.toDestination();
}, 1);
});
it("outputs -1 for an input value of 0", () => {
return ConstantOutput(() => {
const sig = new Zero();
const g2a = new GainToAudio();
sig.connect(g2a);
g2a.toDestination();
}, -1);
});
});
});