Skip to content

Commit e2dc044

Browse files
committed
Tests for 0m, 0h, 0d, 0w, 0y durations
1 parent c446a90 commit e2dc044

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/RemoteAssetCacheTest.js

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const RemoteAssetCache = require("../src/RemoteAssetCache");
66

77
test("getDurationMs", (t) => {
88
let cache = new RemoteAssetCache("https://example.com/");
9+
// t.is(cache.getDurationMs("0"), 0);
10+
t.is(cache.getDurationMs("0s"), 0);
911
t.is(cache.getDurationMs("1s"), 1000);
1012
t.is(cache.getDurationMs("1m"), 60 * 1000);
1113
t.is(cache.getDurationMs("1h"), 60 * 60 * 1000);
@@ -14,11 +16,16 @@ test("getDurationMs", (t) => {
1416
t.is(cache.getDurationMs("1y"), 365 * 24 * 60 * 60 * 1000);
1517

1618
t.is(cache.getDurationMs("5s"), 5000);
19+
t.is(cache.getDurationMs("0m"), 0);
1720
t.is(cache.getDurationMs("7m"), 60 * 7000);
1821
t.is(cache.getDurationMs("9h"), 60 * 60 * 9000);
22+
t.is(cache.getDurationMs("0h"), 0);
1923
t.is(cache.getDurationMs("11d"), 24 * 60 * 60 * 11000);
24+
t.is(cache.getDurationMs("0d"), 0);
2025
t.is(cache.getDurationMs("13w"), 7 * 24 * 60 * 60 * 13000);
26+
t.is(cache.getDurationMs("0w"), 0);
2127
t.is(cache.getDurationMs("15y"), 365 * 24 * 60 * 60 * 15000);
28+
t.is(cache.getDurationMs("0y"), 0);
2229
});
2330

2431
test("Local hash file names", async (t) => {

0 commit comments

Comments
 (0)