diff options
Diffstat (limited to 'cli/tests/unit/cache_api_test.ts')
-rw-r--r-- | cli/tests/unit/cache_api_test.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/tests/unit/cache_api_test.ts b/cli/tests/unit/cache_api_test.ts index 7bc372003..7bca16d89 100644 --- a/cli/tests/unit/cache_api_test.ts +++ b/cli/tests/unit/cache_api_test.ts @@ -4,6 +4,7 @@ import { assertEquals, assertFalse, assertRejects, + assertThrows, } from "./test_util.ts"; Deno.test(async function cacheStorage() { @@ -95,6 +96,13 @@ Deno.test(async function cacheApi() { assertFalse(await caches.has(cacheName)); }); +Deno.test(function cacheIllegalConstructor() { + // @ts-expect-error illegal constructor + assertThrows(() => new Cache(), TypeError, "Illegal constructor"); + // @ts-expect-error illegal constructor + assertThrows(() => new Cache("foo", "bar"), TypeError, "Illegal constructor"); +}); + Deno.test(async function cachePutReaderLock() { const cacheName = "cache-v1"; const cache = await caches.open(cacheName); |