UNPKG

chordpro-parser

Version:

Chordpro Parser based on the chordsheejs module

32 lines (25 loc) 884 B
var chai = require('chai'); chai.use(require('chai-string')); var expect = chai.expect; var parser = require("../index"); describe("Chordpro Parser", function() { describe("Chordpro to Text parsing", function() { it("parses basic chordpro format text", function() { const chordSheet = ` {title: Let it be} {subtitle: ChordSheetJS example version} {Chorus} Let it [Am]be, let it [C/G]be, let it [F]be, let it [C]be [C]Whisper words of [G]wisdom, let it [F]be [C/E] [Dm] [C]`.substring(1); const result = ` LET IT BE ChordSheetJS example version Am C/G F C Let it be, let it be, let it be, let it be C G F C/E Dm C Whisper words of wisdom, let it be`.substring(1); const song = parser.parse(chordSheet); expect(song).to.equalIgnoreSpaces(result); }); }); });