22 lines
452 B
TypeScript
22 lines
452 B
TypeScript
|
import {
|
||
|
basicCheck,
|
||
|
describe,
|
||
|
disableLocalStorage,
|
||
|
expect,
|
||
|
it,
|
||
|
} from "./testing.ts";
|
||
|
import { LocalStorage } from "./local.ts";
|
||
|
|
||
|
describe(LocalStorage, () => {
|
||
|
it("uses localStorage as storage", async () => {
|
||
|
const storage = new LocalStorage();
|
||
|
await basicCheck(storage);
|
||
|
|
||
|
await disableLocalStorage(async () => {
|
||
|
expect(() => new LocalStorage()).toThrow(
|
||
|
"localStorage not available",
|
||
|
);
|
||
|
});
|
||
|
});
|
||
|
});
|