Skip to content

Add observation for Dexie users #75

@hyphenized

Description

@hyphenized

When using Dexie.js, it caches the global indexedDB variable, so resetting the db state won't work as expected. An easy fix is to manually handle each constructor call to explicitly use a new instance of fakeIndexedDB or add a getter to override the value in your test setup like this:

Object.defineProperty(Dexie.dependencies, "indexedDB", {
  get: () => indexedDB,
})

So far I've tracked this back to 3.0.3 which is the version we're currently using.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions