Add testcase for parsing duration

Ref #68
This commit is contained in:
Nemo 2021-07-21 12:08:04 +05:30
parent ce845195cf
commit 3fdb7739ff
1 changed files with 14 additions and 0 deletions

View File

@ -76,6 +76,20 @@ describe("Parser", function() {
})
});
it("should parse durations when given", function() {
let result = parse(`1. Artist - Title - 6:19
2. Another Artist - Another Title - 6:59
3. Yet Another Artist - Yet another title - 5:12`)
assert.deepEqual(result[0], {
artist: "Artist",
title: "Title",
track: 1,
start: { ts: "00:00:00", hh: 0, mm: 0, ss: 0, calc: 0 },
end: { ts: "00:06:19", hh: 0, mm: 6, ss: 19, calc: 379 },
_: { left_text: "Artist - Title", right_text: "" },
})
});
it("should parse taylor swift", function() {
let result = parse(`0:00 the 1
3:29 cardigan