<commit_before>import { expect } from "chai";
import { BasicTests } from "test/helper/Basic";
import { Offline, whenBetween } from "test/helper/Offline";
import { Time } from "Tone/core/type/Time";
import { noOp } from "Tone/core/util/Interface";
import { ToneEvent } from "./ToneEvent";

describe("ToneEvent", () => {

	BasicTests(ToneEvent);

	context("Constructor", () => {

		it("takes a callback and a value", () => {
			return Offline(() => {
				const callback = noOp;
				const note = new ToneEvent(callback, "C4");
				expect(note.callback).to.equal(callback);
				expect(note.value).to.equal("C4");
				note.dispose();
			});
		});

		it("can be constructed with no arguments", () => {
			return Offline(() => {
				const note = new ToneEvent();
				expect(note.value).to.be.null;
				note.dispose();
			});
		});

		it.skip("can pass in arguments in options object", () => {
			return Offline(() => {
				const callback = noOp;
				const value = { a : 1 };
				const note = new ToneEvent({<commit_msg>can use an object as a value<commit_after>import { expect } from "chai";
import { BasicTests } from "test/helper/Basic";
import { Offline, whenBetween } from "test/helper/Offline";
import { Time } from "Tone/core/type/Time";
import { noOp } from "Tone/core/util/Interface";
import { ToneEvent } from "./ToneEvent";

describe("ToneEvent", () => {

	BasicTests(ToneEvent);

	context("Constructor", () => {

		it("takes a callback and a value", () => {
			return Offline(() => {
				const callback = noOp;
				const note = new ToneEvent(callback, "C4");
				expect(note.callback).to.equal(callback);
				expect(note.value).to.equal("C4");
				note.dispose();
			});
		});

		it("can be constructed with no arguments", () => {
			return Offline(() => {
				const note = new ToneEvent();
				expect(note.value).to.be.null;
				note.dispose();
			});
		});

		it("can pass in arguments in options object", () => {
			return Offline(() => {
				const callback = noOp;
				const value = { a : 1 };
				const note = new ToneEvent({
{'fraction_non_alphanumeric': 0.17748279252704033, 'fraction_numerical': 0.0029498525073746312, 'mean_word_length': 3.4047619047619047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1655640', 'n_tokens_mistral': 767, 'n_tokens_neox': 654, 'n_words': 167}