mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(ext/cache): illegal constructor (#16205)
This commit is contained in:
parent
07213dec94
commit
5252ff5dbd
3 changed files with 20 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue