delete existing db first
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { SlopDB } from "../scripts/indexed-db.js"
|
import { SlopDB } from "../scripts/indexed-db.js"
|
||||||
|
import { deleteDB } from "../scripts/idb/index.js"
|
||||||
|
|
||||||
describe("sanity check", () => {
|
describe("sanity check", () => {
|
||||||
it("works", () => {
|
it("works", () => {
|
||||||
@@ -9,14 +10,7 @@ describe("sanity check", () => {
|
|||||||
describe("SlopDB Version 1", () => {
|
describe("SlopDB Version 1", () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
const request = window.indexedDB.deleteDatabase("SlopDB")
|
await deleteDB("SlopDB")
|
||||||
const deletePromise = new Promise((resolve, reject) => {
|
|
||||||
request.onsuccess = () => {resolve()}
|
|
||||||
request.onerror = (err) => {
|
|
||||||
reject(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return deletePromise
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("creates a version 1 indexeddb", async () => {
|
it("creates a version 1 indexeddb", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user