From 233e529abefa9837c39aec1bdfff64a63ae7381e Mon Sep 17 00:00:00 2001 From: hugoalh Date: Wed, 23 Oct 2024 15:02:37 +0800 Subject: [PATCH] Update test --- mod.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mod.test.ts b/mod.test.ts index 8bd3e7a..8fa7a0d 100644 --- a/mod.test.ts +++ b/mod.test.ts @@ -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"); });