forked from martijnversluis/ChordSheetJS
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Background & Motivation
A couple of small code tweaks make this possible but there are some tests that are testing specifically for warnings when this happens:
describe('when encountering {start_of_chorus} while the current section type is not none', () => {
it('adds a parser warning', () => {
const invalidChordSheet = '{start_of_verse}\n{start_of_chorus}';
const parser = new ChordProParser();
parser.parse(invalidChordSheet);
expect(parser.warnings).toHaveLength(1);
expect(parser.warnings[0].toString()).toMatch(/unexpected.+start_of_chorus.+current.+verse.+line 2/i);
});
});
describe('when encountering {start_of_verse} while the current section type is not none', () => {
it('adds a parser warning', () => {
const invalidChordSheet = '{start_of_chorus}\n{start_of_verse}';
const parser = new ChordProParser();
parser.parse(invalidChordSheet);
expect(parser.warnings).toHaveLength(1);
expect(parser.warnings[0].toString()).toMatch(/unexpected.+start_of_verse.+current.+chorus.+line 2/i);
});
});Proposed Solution
Possible solutions
Adjust the code in the song.ts so it won't throw warnings.... and remove the tests.
or
Add a configuration to the song for something like "endSectionsOptional"
Metadata
Metadata
Assignees
Labels
No labels