Skip to content

API to simulate the "close" event #50

Open
@nolanlawson

Description

@nolanlawson

The "close" event on an IDBDatabase only fires when the database closes for an abnormal reason, as described in the spec. (An abnormal reason would be something like the user clearing their browser data while the IDB connection is open.)

For unit testing, it would be neat if fakeIndexedDB had an API for simulating this abnormal close event. Presumably it would just be a matter of running db.close() plus firing an event. (I would do this in userland, but it seems that fakeIndexedDB throws an error if you try to call db.dispatchEvent(new CustomEvent('close')).

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