Skip to content

Commit

Permalink
Remove references to VexFlowTests where possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronyeh committed Jul 28, 2021
1 parent fc34535 commit 11a6a33
Show file tree
Hide file tree
Showing 20 changed files with 122 additions and 144 deletions.
40 changes: 20 additions & 20 deletions tests/barline_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@ const BarlineTests = (function () {
QUnit.module('Barline');

run('Simple BarNotes', function (options) {
var vf = VexFlowTests.makeFactory(options, 380, 160);
var stave = vf.Stave();
var f = VexFlowTests.makeFactory(options, 380, 160);
var stave = f.Stave();

var notes = [
vf.StaveNote({ keys: ['d/4', 'e/4', 'f/4'], stem_direction: -1, duration: '2' }),
vf.BarNote({ type: 'single' }),
vf
f.StaveNote({ keys: ['d/4', 'e/4', 'f/4'], stem_direction: -1, duration: '2' }),
f.BarNote({ type: 'single' }),
f
.StaveNote({ keys: ['c/4', 'f/4', 'a/4'], stem_direction: -1, duration: '2' })
.addAccidental(0, vf.Accidental({ type: 'n' }))
.addAccidental(1, vf.Accidental({ type: '#' })),
.addAccidental(0, f.Accidental({ type: 'n' }))
.addAccidental(1, f.Accidental({ type: '#' })),
];

var voice = vf.Voice().addTickables(notes);
var voice = f.Voice().addTickables(notes);

vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
f.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();
f.draw();

ok(true, 'Simple Test');
});
run('Style BarNotes', function (options) {
var vf = VexFlowTests.makeFactory(options, 380, 160);
var stave = vf.Stave();
var f = VexFlowTests.makeFactory(options, 380, 160);
var stave = f.Stave();

var notes = [
vf.StaveNote({ keys: ['d/4', 'e/4', 'f/4'], stem_direction: -1, duration: '2' }),
vf.BarNote({ type: 'single' }),
vf
f.StaveNote({ keys: ['d/4', 'e/4', 'f/4'], stem_direction: -1, duration: '2' }),
f.BarNote({ type: 'single' }),
f
.StaveNote({ keys: ['c/4', 'f/4', 'a/4'], stem_direction: -1, duration: '2' })
.addAccidental(0, vf.Accidental({ type: 'n' }))
.addAccidental(1, vf.Accidental({ type: '#' })),
.addAccidental(0, f.Accidental({ type: 'n' }))
.addAccidental(1, f.Accidental({ type: '#' })),
];
notes[1].setStyle({ shadowBlur: 15, shadowColor: 'blue', fillStyle: 'blue', strokeStyle: 'blue' });

var voice = vf.Voice().addTickables(notes);
var voice = f.Voice().addTickables(notes);

vf.Formatter().joinVoices([voice]).formatToStave([voice], stave);
f.Formatter().joinVoices([voice]).formatToStave([voice], stave);

vf.draw();
f.draw();

ok(true, 'Style');
});
Expand Down
10 changes: 5 additions & 5 deletions tests/bend_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const BendTests = (function () {
var Bend = {
Start: function () {
QUnit.module('Bend');
VexFlowTests.runTests('Double Bends', VexFlowTests.Bend.doubleBends);
VexFlowTests.runTests('Reverse Bends', VexFlowTests.Bend.reverseBends);
VexFlowTests.runTests('Bend Phrase', VexFlowTests.Bend.bendPhrase);
VexFlowTests.runTests('Double Bends With Release', VexFlowTests.Bend.doubleBendsWithRelease);
VexFlowTests.runTests('Whako Bend', VexFlowTests.Bend.whackoBends);
VexFlowTests.runTests('Double Bends', Bend.doubleBends);
VexFlowTests.runTests('Reverse Bends', Bend.reverseBends);
VexFlowTests.runTests('Bend Phrase', Bend.bendPhrase);
VexFlowTests.runTests('Double Bends With Release', Bend.doubleBendsWithRelease);
VexFlowTests.runTests('Whako Bend', Bend.whackoBends);
},

doubleBends: function (options, contextBuilder) {
Expand Down
10 changes: 5 additions & 5 deletions tests/clef_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const ClefTests = (function () {
var Clef = {
Start: function () {
QUnit.module('Clef');
VexFlowTests.runTests('Clef Test', VexFlowTests.Clef.draw);
VexFlowTests.runTests('Clef End Test', VexFlowTests.Clef.drawEnd);
VexFlowTests.runTests('Small Clef Test', VexFlowTests.Clef.drawSmall);
VexFlowTests.runTests('Small Clef End Test', VexFlowTests.Clef.drawSmallEnd);
VexFlowTests.runTests('Clef Change Test', VexFlowTests.Clef.drawClefChange);
VexFlowTests.runTests('Clef Test', Clef.draw);
VexFlowTests.runTests('Clef End Test', Clef.drawEnd);
VexFlowTests.runTests('Small Clef Test', Clef.drawSmall);
VexFlowTests.runTests('Small Clef End Test', Clef.drawSmallEnd);
VexFlowTests.runTests('Clef Change Test', Clef.drawClefChange);
},

draw: function (options) {
Expand Down
5 changes: 2 additions & 3 deletions tests/dot_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const DotTests = (function () {
var Dot = {
Start: function () {
QUnit.module('Dot');
VexFlowTests.runTests('Basic', VexFlowTests.Dot.basic);
VexFlowTests.runTests('Multi Voice', VexFlowTests.Dot.multiVoice);
VexFlowTests.runTests('Basic', Dot.basic);
VexFlowTests.runTests('Multi Voice', Dot.multiVoice);
},

basic: function (options, contextBuilder) {
Expand Down Expand Up @@ -169,5 +169,4 @@ const DotTests = (function () {

return Dot;
})();
VexFlowTests.Dot = DotTests;
export { DotTests };
20 changes: 8 additions & 12 deletions tests/gracenote_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ const GraceNoteTests = (function () {
var GraceNote = {
Start: function () {
QUnit.module('Grace Notes');
VexFlowTests.runTests('Grace Note Basic', VexFlowTests.GraceNote.basic);
VexFlowTests.runTests('Grace Note Basic with Slurs', VexFlowTests.GraceNote.basicSlurred);
VexFlowTests.runTests('Grace Note Stem', VexFlowTests.GraceNote.stem);
VexFlowTests.runTests('Grace Note Stem with Beams', VexFlowTests.GraceNote.stemWithBeamed);
VexFlowTests.runTests('Grace Note Slash', VexFlowTests.GraceNote.slash);
VexFlowTests.runTests('Grace Note Slash with Beams', VexFlowTests.GraceNote.slashWithBeams);
VexFlowTests.runTests('Grace Notes Multiple Voices', VexFlowTests.GraceNote.multipleVoices);
VexFlowTests.runTests(
'Grace Notes Multiple Voices Multiple Draws',
VexFlowTests.GraceNote.multipleVoicesMultipleDraws
);
VexFlowTests.runTests('Grace Note Basic', GraceNote.basic);
VexFlowTests.runTests('Grace Note Basic with Slurs', GraceNote.basicSlurred);
VexFlowTests.runTests('Grace Note Stem', GraceNote.stem);
VexFlowTests.runTests('Grace Note Stem with Beams', GraceNote.stemWithBeamed);
VexFlowTests.runTests('Grace Note Slash', GraceNote.slash);
VexFlowTests.runTests('Grace Note Slash with Beams', GraceNote.slashWithBeams);
VexFlowTests.runTests('Grace Notes Multiple Voices', GraceNote.multipleVoices);
VexFlowTests.runTests('Grace Notes Multiple Voices Multiple Draws', GraceNote.multipleVoicesMultipleDraws);
},

basic: function (options) {
Expand Down Expand Up @@ -466,5 +463,4 @@ const GraceNoteTests = (function () {

return GraceNote;
})();
VexFlowTests.GraceNote = GraceNoteTests;
export { GraceNoteTests };
9 changes: 4 additions & 5 deletions tests/gracetabnote_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const GraceTabNoteTests = (function () {
var GraceTabNote = {
Start: function () {
QUnit.module('Grace Tab Notes');
VexFlowTests.runTests('Grace Tab Note Simple', VexFlowTests.GraceTabNote.simple);
VexFlowTests.runTests('Grace Tab Note Slurred', VexFlowTests.GraceTabNote.slurred);
VexFlowTests.runTests('Grace Tab Note Simple', GraceTabNote.simple);
VexFlowTests.runTests('Grace Tab Note Slurred', GraceTabNote.slurred);
},

setupContext: function (options, x) {
Expand All @@ -19,7 +19,7 @@ const GraceTabNoteTests = (function () {

simple: function (options, contextBuilder) {
options.contextBuilder = contextBuilder;
var c = VexFlowTests.GraceTabNote.setupContext(options);
var c = GraceTabNote.setupContext(options);
function newNote(tab_struct) {
return new VF.TabNote(tab_struct);
}
Expand Down Expand Up @@ -69,7 +69,7 @@ const GraceTabNoteTests = (function () {

slurred: function (options, contextBuilder) {
options.contextBuilder = contextBuilder;
var c = VexFlowTests.GraceTabNote.setupContext(options);
var c = GraceTabNote.setupContext(options);
function newNote(tab_struct) {
return new VF.TabNote(tab_struct);
}
Expand Down Expand Up @@ -111,5 +111,4 @@ const GraceTabNoteTests = (function () {

return GraceTabNote;
})();
VexFlowTests.GraceTabNote = GraceTabNoteTests;
export { GraceTabNoteTests };
37 changes: 17 additions & 20 deletions tests/key_clef_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const ClefKeySignatureTests = (function () {

Start: function () {
QUnit.module('Clef Keys');
QUnit.test('Key Parser Test', VexFlowTests.ClefKeySignature.parser);
VexFlowTests.runTests('Major Key Clef Test', VexFlowTests.ClefKeySignature.keys, { majorKeys: true });
VexFlowTests.runTests('Minor Key Clef Test', VexFlowTests.ClefKeySignature.keys, { majorKeys: false });
VexFlowTests.runTests('Stave Helper', VexFlowTests.ClefKeySignature.staveHelper);
QUnit.test('Key Parser Test', ClefKeySignature.parser);
VexFlowTests.runTests('Major Key Clef Test', ClefKeySignature.keys, { majorKeys: true });
VexFlowTests.runTests('Minor Key Clef Test', ClefKeySignature.keys, { majorKeys: false });
VexFlowTests.runTests('Stave Helper', ClefKeySignature.staveHelper);
},

catchError: function (spec) {
Expand All @@ -26,17 +26,17 @@ const ClefKeySignatureTests = (function () {

parser: function () {
expect(11);
VexFlowTests.ClefKeySignature.catchError('asdf');
VexFlowTests.ClefKeySignature.catchError('D!');
VexFlowTests.ClefKeySignature.catchError('E#');
VexFlowTests.ClefKeySignature.catchError('D#');
VexFlowTests.ClefKeySignature.catchError('#');
VexFlowTests.ClefKeySignature.catchError('b');
VexFlowTests.ClefKeySignature.catchError('Kb');
VexFlowTests.ClefKeySignature.catchError('Fb');
VexFlowTests.ClefKeySignature.catchError('Ab');
VexFlowTests.ClefKeySignature.catchError('Dbm');
VexFlowTests.ClefKeySignature.catchError('B#m');
ClefKeySignature.catchError('asdf');
ClefKeySignature.catchError('D!');
ClefKeySignature.catchError('E#');
ClefKeySignature.catchError('D#');
ClefKeySignature.catchError('#');
ClefKeySignature.catchError('b');
ClefKeySignature.catchError('Kb');
ClefKeySignature.catchError('Fb');
ClefKeySignature.catchError('Ab');
ClefKeySignature.catchError('Dbm');
ClefKeySignature.catchError('B#m');

VF.keySignature('B');
VF.keySignature('C');
Expand Down Expand Up @@ -66,9 +66,7 @@ const ClefKeySignatureTests = (function () {

var ctx = contextBuilder(options.elementId, 400, 20 + 80 * 2 * clefs.length);
var staves = [];
var keys = options.params.majorKeys
? VexFlowTests.ClefKeySignature.MAJOR_KEYS
: VexFlowTests.ClefKeySignature.MINOR_KEYS;
var keys = options.params.majorKeys ? ClefKeySignature.MAJOR_KEYS : ClefKeySignature.MINOR_KEYS;

var i;
var flat;
Expand Down Expand Up @@ -108,7 +106,7 @@ const ClefKeySignatureTests = (function () {
var stave2 = new VF.Stave(10, 90, 370);
var stave3 = new VF.Stave(10, 170, 370);
var stave4 = new VF.Stave(10, 260, 370);
var keys = VexFlowTests.ClefKeySignature.MAJOR_KEYS;
var keys = ClefKeySignature.MAJOR_KEYS;

stave.addClef('treble');
stave2.addClef('bass');
Expand Down Expand Up @@ -140,5 +138,4 @@ const ClefKeySignatureTests = (function () {

return ClefKeySignature;
})();
VexFlowTests.ClefKeySignature = ClefKeySignatureTests;
export { ClefKeySignatureTests };
5 changes: 2 additions & 3 deletions tests/keymanager_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const KeyManagerTests = (function () {
var KeyManager = {
Start: function () {
QUnit.module('KeyManager');
test('Valid Notes', VexFlowTests.KeyManager.works);
test('Select Notes', VexFlowTests.KeyManager.selectNotes);
test('Valid Notes', KeyManager.works);
test('Select Notes', KeyManager.selectNotes);
},

works: function () {
Expand Down Expand Up @@ -81,5 +81,4 @@ const KeyManagerTests = (function () {

return KeyManager;
})();
VexFlowTests.KeyManager = KeyManagerTests;
export { KeyManagerTests };
29 changes: 14 additions & 15 deletions tests/keysignature_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const KeySignatureTests = (function () {

Start: function () {
QUnit.module('KeySignature');
test('Key Parser Test', VexFlowTests.KeySignature.parser);
VexFlowTests.runTests('Major Key Test', VexFlowTests.KeySignature.majorKeys);
VexFlowTests.runTests('Minor Key Test', VexFlowTests.KeySignature.minorKeys);
VexFlowTests.runTests('Stave Helper', VexFlowTests.KeySignature.staveHelper);
VexFlowTests.runTests('Cancelled key test', VexFlowTests.KeySignature.majorKeysCanceled);
VexFlowTests.runTests('Cancelled key (for each clef) test', VexFlowTests.KeySignature.keysCanceledForEachClef);
VexFlowTests.runTests('Altered key test', VexFlowTests.KeySignature.majorKeysAltered);
VexFlowTests.runTests('End key with clef test', VexFlowTests.KeySignature.endKeyWithClef);
VexFlowTests.runTests('Key Signature Change test', VexFlowTests.KeySignature.changeKey);
test('Key Parser Test', KeySignature.parser);
VexFlowTests.runTests('Major Key Test', KeySignature.majorKeys);
VexFlowTests.runTests('Minor Key Test', KeySignature.minorKeys);
VexFlowTests.runTests('Stave Helper', KeySignature.staveHelper);
VexFlowTests.runTests('Cancelled key test', KeySignature.majorKeysCanceled);
VexFlowTests.runTests('Cancelled key (for each clef) test', KeySignature.keysCanceledForEachClef);
VexFlowTests.runTests('Altered key test', KeySignature.majorKeysAltered);
VexFlowTests.runTests('End key with clef test', KeySignature.endKeyWithClef);
VexFlowTests.runTests('Key Signature Change test', KeySignature.changeKey);
},

parser: function () {
Expand Down Expand Up @@ -58,7 +58,7 @@ const KeySignatureTests = (function () {
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VexFlowTests.KeySignature.MAJOR_KEYS;
var keys = KeySignature.MAJOR_KEYS;

var keySig = null;
for (var i = 0; i < 8; ++i) {
Expand Down Expand Up @@ -86,7 +86,7 @@ const KeySignatureTests = (function () {
var stave2 = new VF.Stave(10, 90, 750).addTrebleGlyph();
var stave3 = new VF.Stave(10, 170, 750).addTrebleGlyph();
var stave4 = new VF.Stave(10, 250, 750).addTrebleGlyph();
var keys = VexFlowTests.KeySignature.MAJOR_KEYS;
var keys = KeySignature.MAJOR_KEYS;

var keySig = null;
var i;
Expand Down Expand Up @@ -166,7 +166,7 @@ const KeySignatureTests = (function () {
var stave2 = new VF.Stave(10, 90, 750).addTrebleGlyph();
var stave3 = new VF.Stave(10, 170, 750).addTrebleGlyph();
var stave4 = new VF.Stave(10, 250, 750).addTrebleGlyph();
var keys = VexFlowTests.KeySignature.MAJOR_KEYS;
var keys = KeySignature.MAJOR_KEYS;

var keySig = null;
var i;
Expand Down Expand Up @@ -215,7 +215,7 @@ const KeySignatureTests = (function () {
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VexFlowTests.KeySignature.MINOR_KEYS;
var keys = KeySignature.MINOR_KEYS;

var keySig = null;
for (var i = 0; i < 8; ++i) {
Expand Down Expand Up @@ -259,7 +259,7 @@ const KeySignatureTests = (function () {
var ctx = contextBuilder(options.elementId, 400, 240);
var stave = new VF.Stave(10, 10, 350);
var stave2 = new VF.Stave(10, 90, 350);
var keys = VexFlowTests.KeySignature.MAJOR_KEYS;
var keys = KeySignature.MAJOR_KEYS;

for (var i = 0; i < 8; ++i) {
stave.addKeySignature(keys[i]);
Expand Down Expand Up @@ -309,5 +309,4 @@ const KeySignatureTests = (function () {

return KeySignature;
})();
VexFlowTests.KeySignature = KeySignatureTests;
export { KeySignatureTests };
1 change: 0 additions & 1 deletion tests/modifier_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ const ModifierContextTests = (function () {

return ModifierContext;
})();
VexFlowTests.ModifierContext = ModifierContextTests;
export { ModifierContextTests };
Loading

0 comments on commit 11a6a33

Please sign in to comment.