From 3fdb7739ff10e4b9b7ae3a8cdd7f4f560862d5ab Mon Sep 17 00:00:00 2001 From: Nemo Date: Wed, 21 Jul 2021 12:08:04 +0530 Subject: [PATCH] Add testcase for parsing duration Ref #68 --- test/parser_test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/parser_test.js b/test/parser_test.js index b4c3c12..67ef90f 100644 --- a/test/parser_test.js +++ b/test/parser_test.js @@ -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