storage/local.test.ts

22 lines
452 B
TypeScript
Raw Normal View History

2021-06-21 22:05:08 +00:00
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",
);
});
});
});