wobsoriano / vitest-canvas-mock

🌗 A module used to mock canvas in Vitest.
MIT License
53 stars 8 forks source link

Followed doc and it makes no difference #14

Open mttetc opened 2 months ago

mttetc commented 2 months ago
/// <reference types="vitest" />
import { defineConfig } from 'vitest/config';
import path from 'path';

export default defineConfig({
  test: {
    environment: 'jsdom',
    setupFiles: ['./vitest.setup.ts'],
    deps: {
      optimizer: {
        web: {
          include: ['vitest-canvas-mock'],
        },
      },
    },
    poolOptions: {
      threads: {
        singleThread: true,
      },
    },
    environmentOptions: {
      jsdom: {
        resources: 'usable',
      },
    },
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
});
Object.<anonymous> ../node_modules/konva/lib/index-node.js:4:16
      2| Object.defineProperty(exports, "__esModule", { value: true });
      3| const _FullInternals_1 = require("./_FullInternals");
      4| const Canvas = require("canvas");
       |                ^
      5| const canvas = Canvas['default'] || Canvas;
      6| global.DOMMatrix = canvas.DOMMatrix;

What am i missing here?