Tone.js/Tone/core/clock/TransportRepeatEvent.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

41 lines
1.1 KiB
TypeScript

import { expect } from "chai";
import { Offline } from "../../../test/helper/Offline.js";
import { TransportClass } from "./Transport.js";
import { TransportRepeatEvent } from "./TransportRepeatEvent.js";
describe("TransportRepeatEvent", () => {
it("can be created and disposed", () => {
return Offline((context) => {
const transport = new TransportClass({ context });
const event = new TransportRepeatEvent(transport, {
duration: 100,
interval: 4,
time: 0,
});
event.dispose();
});
});
it("generates a unique event ID", () => {
return Offline((context) => {
const transport = new TransportClass({ context });
const event = new TransportRepeatEvent(transport, {
time: 0,
});
expect(event.id).to.be.a("number");
event.dispose();
});
});
it("is removed from the Transport when disposed", () => {
return Offline((context) => {
const transport = new TransportClass({ context });
const event = new TransportRepeatEvent(transport, {
time: 0,
});
event.dispose();
// @ts-ignore
expect(transport._timeline.length).to.equal(0);
});
});
});