Skip to content

Commit

Permalink
New approach: do not include vexflow-debug.js on flow.html.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronyeh committed Jul 25, 2021
1 parent 016e652 commit 6981e7e
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 75 deletions.
12 changes: 8 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ module.exports = (grunt) => {
? `import { Vex } from './src/vex';`
: `import { VexFlowTests } from './tests/vexflow_test_helpers';`;
const vf = isVexSRC ? 'Vex.Flow' : 'Vex.Flow.Test';
return `${importVex}
${vf}.VERSION = "${packageJSON.version}";
${vf}.BUILD = "${GIT_COMMIT_HASH}";`;

return '';

// TODO: Fix this!
// return `${importVex}
// ${vf}.VERSION = "${packageJSON.version}";
// ${vf}.BUILD = "${GIT_COMMIT_HASH}";`;
}),
// Add a banner at the top of the file.
new webpack.BannerPlugin(BANNER),
Expand Down Expand Up @@ -117,7 +121,7 @@ module.exports = (grunt) => {
'tsconfig.json',
MODULE_ENTRY_TESTS,
'development',
'VFTests'
'Vex' /* Previously VFTests. TODO: Remove this! */
);

grunt.initConfig({
Expand Down
28 changes: 18 additions & 10 deletions tests/flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,24 @@
.attr('href', vexURL)
.text('VexFlow Source' + info);

loadScript(vexURL)
.then(function () {
return loadScript(testsURL);
})
.then(function () {
// Show only failed tests.
QUnit.config.hidepassed = true;
QUnit.config.noglobals = true;
VF.Test.run();
});
// loadScript(vexURL)
// .then(function () {
// return loadScript(testsURL);
// })
// .then(function () {
// // Show only failed tests.
// QUnit.config.hidepassed = true;
// QUnit.config.noglobals = true;
// VF.Test.run();
// });
// });

loadScript(testsURL).then(function () {
// Show only failed tests.
QUnit.config.hidepassed = true;
QUnit.config.noglobals = true;
Vex.Flow.Test.run();
});
});
</script>
</head>
Expand Down
5 changes: 3 additions & 2 deletions tests/rests_tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
// MIT License

import { Vex } from '../src/vex';
import { QUnit, ok } from './declarations';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';
import { RenderContext } from '../src/types/common';
Expand All @@ -8,8 +10,7 @@ import { StaveNoteStruct } from '../src/stavenote';
import { Stave } from '../src/stave';
import { ContextBuilder } from '../src/renderer';

// TODO: Fix later! Currently we need to prepend all classes with VF.
const VF: any = Vex.Flow; // eslint-disable-line
const VF: any = Vex.Flow;

// Optional: arrow function to make your code more concise.
const note = (s: StaveNoteStruct) => new VF.StaveNote(s);
Expand Down
121 changes: 62 additions & 59 deletions tests/run.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Vex } from '../src/vex';
import { VexFlowTests } from './vexflow_test_helpers';
import { AccidentalTests } from './accidental_tests';
import { StaveNoteTests } from './stavenote_tests';
Expand Down Expand Up @@ -61,64 +62,66 @@ import { BachDemoTests } from './bach_tests';
import { GlyphNoteTests } from './glyphnote_tests';

VexFlowTests.run = function () {
AccidentalTests.Start();
StaveNoteTests.Start();
VoiceTests.Start();
NoteHeadTests.Start();
TabNoteTests.Start();
TickContextTests.Start();
ModifierContextTests.Start();
DotTests.Start();
BendTests.Start();
FormatterTests.Start();
FractionTests.Start();
ClefTests.Start();
KeySignatureTests.Start();
TimeSignatureTests.Start();
StaveTieTests.Start();
TabTieTests.Start();
StaveTests.Start();
TabStaveTests.Start();
TabSlideTests.Start();
BeamTests.Start();
BarlineTests.Start();
AutoBeamFormattingTests.Start();
GraceNoteTests.Start();
GraceTabNoteTests.Start();
VibratoTests.Start();
VibratoBracketTests.Start();
AnnotationTests.Start();
ChordSymbolTests.Start();
TuningTests.Start();
MusicTests.Start();
KeyManagerTests.Start();
ArticulationTests.Start();
StaveConnectorTests.Start();
MultiMeasureRestTests.Start();
PercussionTests.Start();
NoteSubGroupTests.Start();
ClefKeySignatureTests.Start();
StaveHairpinTests.Start();
RhythmTests.Start();
TupletTests.Start();
BoundingBoxTests.Start();
StrokesTests.Start();
StringNumberTests.Start();
// AccidentalTests.Start();
// StaveNoteTests.Start();
// VoiceTests.Start();
// NoteHeadTests.Start();
// TabNoteTests.Start();
// TickContextTests.Start();
// ModifierContextTests.Start();
// DotTests.Start();
// BendTests.Start();
// FormatterTests.Start();
// FractionTests.Start();
// ClefTests.Start();
// KeySignatureTests.Start();
// TimeSignatureTests.Start();
// StaveTieTests.Start();
// TabTieTests.Start();
// StaveTests.Start();
// TabStaveTests.Start();
// TabSlideTests.Start();
// BeamTests.Start();
// BarlineTests.Start();
// AutoBeamFormattingTests.Start();
// GraceNoteTests.Start();
// GraceTabNoteTests.Start();
// VibratoTests.Start();
// VibratoBracketTests.Start();
// AnnotationTests.Start();
// ChordSymbolTests.Start();
// TuningTests.Start();
// MusicTests.Start();
// KeyManagerTests.Start();
// ArticulationTests.Start();
// StaveConnectorTests.Start();
// MultiMeasureRestTests.Start();
// PercussionTests.Start();
// NoteSubGroupTests.Start();
// ClefKeySignatureTests.Start();
// StaveHairpinTests.Start();
// RhythmTests.Start();
// TupletTests.Start();
// BoundingBoxTests.Start();
// StrokesTests.Start();
// StringNumberTests.Start();
RestsTests.Start();
ThreeVoicesTests.Start();
CurveTests.Start();
TextNoteTests.Start();
StaveLineTests.Start();
OrnamentTests.Start();
PedalMarkingTests.Start();
TextBracketTests.Start();
StaveModifierTests.Start();
GhostNoteTests.Start();
StyleTests.Start();
FactoryTests.Start();
ParserTests.Start();
EasyScoreTests.Start();
RegistryTests.Start();
BachDemoTests.Start();
GlyphNoteTests.Start();
// ThreeVoicesTests.Start();
// CurveTests.Start();
// TextNoteTests.Start();
// StaveLineTests.Start();
// OrnamentTests.Start();
// PedalMarkingTests.Start();
// TextBracketTests.Start();
// StaveModifierTests.Start();
// GhostNoteTests.Start();
// StyleTests.Start();
// FactoryTests.Start();
// ParserTests.Start();
// EasyScoreTests.Start();
// RegistryTests.Start();
// BachDemoTests.Start();
// GlyphNoteTests.Start();
};

export default Vex;
1 change: 1 addition & 0 deletions tests/vexflow_test_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//
// VexFlow Test Support Library

import { Vex } from '../src/vex';
import { Font } from '../src/font';
import { ContextBuilder, Renderer } from '../src/renderer';
import { RenderContext } from '../src/types/common';
Expand Down

0 comments on commit 6981e7e

Please sign in to comment.