wobsoriano / vitest-canvas-mock

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

Configuration with Vitest 0.34 #9

Closed titenis closed 11 months ago

titenis commented 12 months ago

Starting with Vitest 0.34 deps.inline is deprecated Vitest "deps.inline" is deprecated. If you rely on vite-node directly, use "server.deps.inline" instead. Otherwise, consider using "deps.optimizer.web.include"

How configuration should be migrated?

deps: {
      inline: ['vitest-canvas-mock'],
    },
wobsoriano commented 11 months ago

I think that depends on your project? But pretty sure you're gonna go with deps.optimizer.web.include.

acelaya commented 11 months ago

I think that depends on your project? But pretty sure you're gonna go with deps.optimizer.web.include.

I can confirm this worked for me.

     deps: {
-      inline: ['vitest-canvas-mock'],
+      optimizer: {
+        web: {
+          include: ['vitest-canvas-mock'],
+        },
+      },
     },

The funny thing is that vitest actually suggest this, but I didn't notice at first:

image

wobsoriano commented 11 months ago

Updated README as well. Thanks!