Skip to content

Commit

Permalink
flow.html provides global access to QUnit functions, so we
Browse files Browse the repository at this point in the history
declare QUnit functions as global in TypeScript (via tests/types/qunit.d.ts).
This simplifies test creation, because we no longer have to import
individual QUnit functions before using them.
  • Loading branch information
ronyeh committed Aug 29, 2021
1 parent 742a4ef commit 9ce76f3
Show file tree
Hide file tree
Showing 65 changed files with 191 additions and 264 deletions.
5 changes: 0 additions & 5 deletions tests/accidental_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok, equal, test } from './types/qunit';
import { Flow } from 'flow';
import { Beam } from 'beam';
import { Formatter } from 'formatter';
Expand Down Expand Up @@ -397,7 +396,6 @@ const AccidentalTests = {
},

microtonal(options: TestOptions): void {
const assert = options.assert;
const f = VexFlowTests.makeFactory(options, 700, 240);
const newAccid = makeNewAccid(f);
const ctx = f.getContext();
Expand Down Expand Up @@ -465,7 +463,6 @@ const AccidentalTests = {
},

microtonal_iranian(options: TestOptions) {
const assert = options.assert;
const f = VexFlowTests.makeFactory(options, 700, 240);
const newAccid = makeNewAccid(f);
const ctx = f.getContext();
Expand Down Expand Up @@ -530,7 +527,6 @@ const AccidentalTests = {
},

sagittal(options: TestOptions): void {
const assert = options.assert;
const f = VexFlowTests.makeFactory(options, 700, 240);
const newAccid = makeNewAccid(f);
const ctx = f.getContext();
Expand Down Expand Up @@ -947,7 +943,6 @@ const AccidentalTests = {
},

factoryAPI(options: TestOptions): void {
const assert = options.assert;
const f = VexFlowTests.makeFactory(options, 700, 240);
f.Stave({ x: 10, y: 10, width: 550 });

Expand Down
1 change: 0 additions & 1 deletion tests/annotation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { ContextBuilder } from 'renderer';
import { Flow } from 'flow';
import { Registry } from 'registry';
Expand Down
1 change: 0 additions & 1 deletion tests/articulation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { StaveNote } from 'stavenote';
import { TabNote } from 'tabnote';
import { TabStave } from 'tabstave';
import { Voice } from 'voice';
import { expect, ok, QUnit } from './types/qunit';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const ArticulationTests = {
Expand Down
1 change: 0 additions & 1 deletion tests/auto_beam_formatting_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions, concat } from './vexflow_test_helpers';
import { QUnit, equal, ok } from './types/qunit';
import { Stem } from 'stem';
import { Fraction } from 'fraction';
import { Beam } from 'beam';
Expand Down
1 change: 0 additions & 1 deletion tests/bach_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions, concat } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { Factory } from 'factory';
import { Registry } from 'registry';
import { BarlineType } from 'stavebarline';
Expand Down
3 changes: 1 addition & 2 deletions tests/barline_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok, Assert, equal } from './types/qunit';
import { Barline, BarlineType } from 'stavebarline';

const BarlineTests = {
Start(): void {
QUnit.module('Barline');

QUnit.test('Enums', function (assert: Assert) {
test('Enums', () => {
equal(Barline.type, BarlineType);
});

Expand Down
1 change: 0 additions & 1 deletion tests/beam_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions, concat } from './vexflow_test_helpers';
import { QUnit, equal, ok, test } from './types/qunit';
import { Beam } from 'beam';
import { Stem } from 'stem';
import { Voice } from 'voice';
Expand Down
1 change: 0 additions & 1 deletion tests/bend_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { ContextBuilder } from 'renderer';
import { Bend, BendPhrase } from 'bend';
import { Formatter } from 'formatter';
Expand Down
1 change: 0 additions & 1 deletion tests/boundingbox_tests.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
// MIT License

import { QUnit, test, equal } from './types/qunit';
import { BoundingBox } from 'boundingbox';

/**
Expand Down
1 change: 0 additions & 1 deletion tests/boundingboxcomputation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// BoundingBoxComputation Tests

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok, test, equal } from './types/qunit';
import { RenderContext } from 'types/common';
import { OutlineCode } from 'glyph';

Expand Down
1 change: 0 additions & 1 deletion tests/chordsymbol_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { ChordSymbol } from 'chordsymbol';
import { StaveNote } from 'stavenote';
import { Formatter } from 'formatter';
Expand Down
4 changes: 0 additions & 4 deletions tests/clef_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
//
// Clef Tests

/* eslint-disable */
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';

const ClefTests = {
Start(): void {
Expand Down
1 change: 0 additions & 1 deletion tests/curve_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, concat, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { Curve } from 'curve';
import { StaveNote } from 'stavenote';
import { Factory } from 'factory';
Expand Down
1 change: 0 additions & 1 deletion tests/dot_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// @ts-nocheck

import { VexFlowTests, TestOptions } from './vexflow_test_helpers';
import { QUnit, ok } from './types/qunit';
import { ModifierContext } from 'modifiercontext';
import { TickContext } from 'tickcontext';
import { ContextBuilder } from 'renderer';
Expand Down
Loading

0 comments on commit 9ce76f3

Please sign in to comment.