mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-14 21:03:55 +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
28 lines
752 B
TypeScript
28 lines
752 B
TypeScript
import { expect } from "chai";
|
|
import { TimelineValue } from "./TimelineValue.js";
|
|
|
|
describe("TimelineValue", () => {
|
|
it("can be created and disposed", () => {
|
|
const sched = new TimelineValue(0);
|
|
sched.dispose();
|
|
});
|
|
|
|
it("can add events to the timeline", () => {
|
|
const sched = new TimelineValue(10);
|
|
sched.set(11, 1);
|
|
sched.set(1, 12);
|
|
sched.set(3, 4);
|
|
expect(sched.get(0)).to.equal(10);
|
|
expect(sched.get(1)).to.equal(11);
|
|
expect(sched.get(2)).to.equal(11);
|
|
expect(sched.get(4)).to.equal(3);
|
|
expect(sched.get(12)).to.equal(1);
|
|
sched.dispose();
|
|
});
|
|
|
|
it("returns the initial value if there is nothing scheduled", () => {
|
|
const sched = new TimelineValue(10);
|
|
expect(sched.get(0)).to.equal(10);
|
|
sched.dispose();
|
|
});
|
|
});
|