<commit_before>import { expect } from "chai";
import { OfflineContext } from "./OfflineContext";

context("OfflineContext", () => {

	it("can be created an disposed", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		ctx.dispose();
	});

	it("is setup with 0 lookAhead and offline clockSource", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		expect(ctx.lookAhead).to.equal(0);
		expect(ctx.clockSource).to.equal("offline");
		return ctx.dispose();
	});

	it("now = currentTime", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		expect(ctx.currentTime).to.equal(ctx.now());
		return ctx.dispose();
	});

	it("can render audio", () => {
		const ctx = new OfflineContext(1, 0.2, 44100);
		const osc = ctx.createOscillator();
		osc.connect(ctx.destination);
		osc.start(0.1);
		return ctx.render().then(buffer => {<commit_msg>needed to pass compiler<commit_after>import { expect } from "chai";
import { OfflineContext } from "./OfflineContext";

context("OfflineContext", () => {

	it("can be created an disposed", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		ctx.dispose();
	});

	it("is setup with 0 lookAhead and offline clockSource", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		expect(ctx.lookAhead).to.equal(0);
		expect(ctx.clockSource).to.equal("offline");
		return ctx.dispose();
	});

	it("now = currentTime", () => {
		const ctx = new OfflineContext(1, 0.1, 44100);
		expect(ctx.currentTime).to.equal(ctx.now());
		return ctx.dispose();
	});

	it("can render audio", () => {
		const ctx = new OfflineContext(1, 0.2, 44100);
		const osc = ctx.createOscillator();
		osc.connect(ctx.rawContext.destination);
		osc.start(0.1);
		return ctx.render().then(buffer => {
{'fraction_non_alphanumeric': 0.18818760856977418, 'fraction_numerical': 0.04169079328314997, 'mean_word_length': 4.284403669724771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5382227', 'n_tokens_mistral': 686, 'n_tokens_neox': 602, 'n_words': 135}