document is not defined in vitest

Resolve this by defining the following in your vitest.config.ts, as shown below. Please make sure you have install jsdom package.


import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
  plugins: [react()],
  test: {
    environment: 'jsdom',
  },
});

Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm