Socket
Book a DemoInstallSign in
Socket

vitest-indexeddb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vitest-indexeddb

Add a shim for IndexdDB when testing with Vitest.

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

vitest-indexeddb

Add a shim for indexeddb when testing with Vitest.

Installation

yarn add -D vitest-indexeddb
npm i -D vitest-indexeddb
pnpm i -D vitest-indexeddb

Usage

An example project can be found at /example for reference.

  • Create a setup file
// ./setup/idbSetup.ts

import { setup } from "vitest-indexeddb";

setup();
  • Include that setup file in your Vitest config.
// ./vite.config.ts

import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    environment: "jsdom",
    setupFiles: ["./setup/idbSetup.ts"],
  },
});
  • Run tests

Keywords

vitest

FAQs

Package last updated on 21 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts