Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed Oct 23, 2024
1 parent 5be55ae commit 233e529
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import { assert } from "STD/assert/assert";
import { assertEquals } from "STD/assert/equals";
import { assertThrows } from "STD/assert/throws";
import { HTTPHeaderRetryAfter } from "./mod.ts";
Deno.test("String Good 1", { permissions: "none" }, () => {
const instance = new HTTPHeaderRetryAfter("Wed, 21 Oct 2015 07:28:00 GMT");
assertEquals(instance.getDate().valueOf(), 1445412480000);
assertEquals(instance.getRemainTimeMilliseconds(), 0);
assertEquals(instance.getRemainTimeSeconds(), 0);
});
Deno.test("String Good 2", { permissions: "none" }, () => {
Deno.test("Stringify Number", { permissions: "none" }, () => {
const instance = new HTTPHeaderRetryAfter("120");
const remainTimeMilliseconds = instance.getRemainTimeMilliseconds();
const remainTimeSeconds = instance.getRemainTimeSeconds();
assert(remainTimeMilliseconds > 0 && remainTimeMilliseconds <= 120000);
assert(remainTimeSeconds > 0 && remainTimeSeconds <= 120);
});
Deno.test("String Bad 1", { permissions: "none" }, () => {
Deno.test("Timestamp GMT", { permissions: "none" }, () => {
const instance = new HTTPHeaderRetryAfter("Wed, 21 Oct 2015 07:28:00 GMT");
assertEquals(instance.getDate().valueOf(), 1445412480000);
assertEquals(instance.getRemainTimeMilliseconds(), 0);
assertEquals(instance.getRemainTimeSeconds(), 0);
});
Deno.test("Timestamp ISO8601", { permissions: "none" }, () => {
assertThrows(() => {
new HTTPHeaderRetryAfter("2011-10-05T14:48:00.000Z");
});
Expand Down

0 comments on commit 233e529

Please sign in to comment.