Skip to content

Commit

Permalink
add canonicalIntervals to the test
Browse files Browse the repository at this point in the history
  • Loading branch information
wassertim committed Apr 4, 2021
1 parent 8fe4a61 commit 83c7aca
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/music_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default (function () {
test('Relative Notes', MusicTests.relativeNotes);
test('Relative Note Names', MusicTests.relativeNoteNames);
test('Canonical Notes', MusicTests.canonicalNotes);
test('Canonical Intervals', MusicTests.canonicalNotes);
test('Canonical Intervals', MusicTests.canonicalIntervals);
test('Scale Tones', MusicTests.scaleTones);
test('Scale Intervals', MusicTests.scaleIntervals);
},
Expand Down Expand Up @@ -222,6 +222,21 @@ export default (function () {
}
},

canonicalIntervals: function () {
expect(3);

var music = new Music();

equal(music.getCanonicalIntervalName(0), 'unison');
equal(music.getCanonicalIntervalName(2), 'M2');

try {
music.getCanonicalIntervalName(-1);
} catch (e) {
ok(true, 'Invalid interval value');
}
},

scaleTones: function () {
expect(24);

Expand Down

0 comments on commit 83c7aca

Please sign in to comment.