How to use the fake-indexeddb.deleteDatabase function in fake-indexeddb

To help you get started, we’ve selected a few fake-indexeddb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WorldBrain / Memex / src / search / __mocks__ / storex.ts View on Github external
}) as any

// Extend storex instance with Memex-specific methods
const instance = new Storex({ backend }) as StorageManager
const oldMethod = instance.collection.bind(instance)
instance.collection = (name: string) => ({
    ...oldMethod(name),
    suggestObjects: (query, opts) =>
        suggestObjects(new Promise(res => res(backend.dexieInstance as Dexie)))(
            name,
            query,
            opts,
        ),
})

instance.deleteDB = indexedDB.deleteDatabase

export default instance