Improve Scale Generator tests

0
open
dem4ron
dem4ron
Posted 6 months ago

Improve Scale Generator tests #1906

Hey!

I'd like to suggest some improvements on the Scale Generator tests.

I think in this form these tests are not correct.

The intervals.length should be scale.length - 1.

    test('Simple major scale', () => {
-      const expected = ['C', 'D', 'E', 'F', 'G', 'A', 'B'];
+      const expected = ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C'];
      expect(new Scale('C').interval('MMmMMMm')).toEqual(expected);
    });

Check the walkthrough at the end of problem-specs description., or tests in other languages, e.g. Rust

This change breaks the proof solution, which I think is a good solution but not ideal if you'd like to generate scales based on any random input in this system. e.g. AAAAAAAAAAAA

I'd also suggest updating the instructions.md, as it seems to be behind the problem-specs description.