aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-10-07 12:19:42 -0400
committerAjay <[email protected]>2022-10-07 12:19:42 -0400
commit61fc1d2ed3bd1df02fc9955d7a57cb4ce9206b5a (patch)
tree404fefe3dd35e67a968674c7a3531ff0dfa317ee /test
parentdabc63af735580b5656fcab92fb365906f7a3728 (diff)
downloadSponsorBlock-61fc1d2ed3bd1df02fc9955d7a57cb4ce9206b5a.tar.gz
SponsorBlock-61fc1d2ed3bd1df02fc9955d7a57cb4ce9206b5a.zip
Fix zero start time breaking
Diffstat (limited to 'test')
-rw-r--r--test/exporter.test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/exporter.test.ts b/test/exporter.test.ts
index 3093d1b8..a3af0c04 100644
--- a/test/exporter.test.ts
+++ b/test/exporter.test.ts
@@ -254,4 +254,25 @@ describe("Import segments", () => {
category: "chapter" as Category
}]);
});
+
+ it ("00:00", () => {
+ const input = ` 00:00 Cap 1
+ 00:10 Cap 2
+ 00:12 Cap 3`;
+
+ const result = importTimes(input, 8000);
+ expect(result).toMatchObject([{
+ segment: [0, 10],
+ description: "Cap 1",
+ category: "chapter" as Category
+ }, {
+ segment: [10, 12],
+ description: "Cap 2",
+ category: "chapter" as Category
+ }, {
+ segment: [12, 8000],
+ description: "Cap 3",
+ category: "chapter" as Category
+ }]);
+ });
}); \ No newline at end of file