2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00
This commit is contained in:
Nikolay Kostyurin
2018-06-04 23:18:50 +02:00
parent d4a41482d3
commit edf90de445
18 changed files with 2403 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const parse = require('./index');
const OldParser = require('./benchmark/OldParser');
const tabText = require('./benchmark/test/stub');
const options = {
closableTags: ['ch', 'syllable', 'tab'],
allowOnlyTags: ['ch', 'syllable', 'tab'],
};
describe("parse", () => {
test("tag with spaces", () => {
const ast = parse(`[Verse 2]`);
expect(ast).toEqual([{tag: 'Verse 2', attrs: {}, content: []}]);
});
test("same as old parser", () => {
const ast1 = parse(tabText, options);
const ast2 = OldParser.parse(tabText);
expect(ast1).toEqual(ast2);
})
});