diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2022-11-17 02:12:58 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 02:12:58 +0900 |
commit | 1d85c2520575ae3a10c21b6559c58127e0bd489a (patch) | |
tree | 9936d1d76224cd2ea6ce6a31a80fa5071b5c2724 /cli/tests/unit/webstorage_test.ts | |
parent | 38542e849d3d1f3fbb1328b82afa135486ef6c2a (diff) |
fix(ext/webstorage): make web storages re-assignable (#16661)
Diffstat (limited to 'cli/tests/unit/webstorage_test.ts')
-rw-r--r-- | cli/tests/unit/webstorage_test.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/unit/webstorage_test.ts b/cli/tests/unit/webstorage_test.ts new file mode 100644 index 000000000..df32e9edb --- /dev/null +++ b/cli/tests/unit/webstorage_test.ts @@ -0,0 +1,13 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file no-explicit-any + +import { assert } from "./test_util.ts"; + +Deno.test({ permissions: "none" }, function webStoragesReassignable() { + // Can reassign to web storages + globalThis.localStorage = 1 as any; + globalThis.sessionStorage = 1 as any; + // The actual values don't change + assert(globalThis.localStorage instanceof globalThis.Storage); + assert(globalThis.sessionStorage instanceof globalThis.Storage); +}); |