<commit_before>import { Compare, Plot } from "@tonejs/plot";
import { expect } from "chai";
import { BasicTests, testAudioContext } from "test/helper/Basic";
import { atTime, Offline } from "test/helper/Offline";
import { SCHEDULE_RAMP_AFTER_SET_TARGET } from "test/helper/Supports";
import { BPM, Decibels, Frequency, Positive, Seconds, Time, Unit, UnitName } from "Tone/core/type/Units";
import { Signal } from "Tone/signal/Signal";
import { getContext } from "../Global";
import { Param } from "./Param";
import { connect } from "./ToneAudioNode";

const audioContext = getContext();

describe("Param", () => {

	BasicTests(Param, {
		param: testAudioContext.createOscillator().frequency,
	});

	context("constructor", () => {
		it("can be created and disposed", async () => {
			await Offline(context => {
				const param = new Param<Time>({
					context,
					param: context.createConstantSource().offset,
					units: "time",
				});
				expect(param.getValueAtTime(0)).to.equal(1);
				param.dispose();
			});
		});

		it("can pass in a value", async () => {
			await Offline(context => {
				const param = new Param({<commit_msg>should pass in context to param test<commit_after>import { Compare, Plot } from "@tonejs/plot";
import { expect } from "chai";
import { BasicTests, testAudioContext } from "test/helper/Basic";
import { atTime, Offline } from "test/helper/Offline";
import { SCHEDULE_RAMP_AFTER_SET_TARGET } from "test/helper/Supports";
import { BPM, Decibels, Frequency, Positive, Seconds, Time, Unit, UnitName } from "Tone/core/type/Units";
import { Signal } from "Tone/signal/Signal";
import { getContext } from "../Global";
import { Param } from "./Param";
import { connect } from "./ToneAudioNode";

const audioContext = getContext();

describe("Param", () => {

	BasicTests(Param, {
		context: testAudioContext,
		param: testAudioContext.createOscillator().frequency,
	});

	context("constructor", () => {
		it("can be created and disposed", async () => {
			await Offline(context => {
				const param = new Param<Time>({
					context,
					param: context.createConstantSource().offset,
					units: "time",
				});
				expect(param.getValueAtTime(0)).to.equal(1);
				param.dispose();
			});
		});

		it("can pass in a value", async () => {
			await Offline(context => {
				const param = new Param({
{'fraction_non_alphanumeric': 0.16006884681583478, 'fraction_numerical': 0.0017211703958691911, 'mean_word_length': 4.178173719376392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '101368', 'n_tokens_mistral': 808, 'n_tokens_neox': 724, 'n_words': 185}