nuxt / test-utils

🧪 Test utilities for Nuxt
http://nuxt.com/docs/getting-started/testing
MIT License
310 stars 79 forks source link

devtools document is not defined #502

Open cannap opened 1 year ago

cannap commented 1 year ago

no idea why this happens normal tests are running :D thanks for this module

image


 recipes  npx envinfo --system  --binaries --browser --npmPackages                                                                                                      

  System:
    OS: Windows 10 10.0.22621
    CPU: (6) x64 Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
    Memory: 3.25 GB / 15.94 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @next-auth/prisma-adapter: ^1.0.5 => 1.0.5 
    @nuxt/devtools: ^0.1.5 => 0.1.5 
    @nuxt/image-edge: 1.0.0-27919678.2f5b64b => 1.0.0-27919678.2f5b64b 
    @nuxt/test-utils: ^3.2.2 => 3.2.2 
    @nuxtjs/color-mode: ^3.2.0 => 3.2.0 
    @nuxtjs/eslint-config-typescript: ^12.0.0 => 12.0.0 
    @nuxtjs/i18n-edge:  8.0.0-beta.9-27948515.3db6367 
    @nuxtjs/tailwindcss: ^6.4.1 => 6.4.1 
    @pinia/nuxt: ^0.4.7 => 0.4.7 
    @prisma/client: ^4.10.1 => 4.10.1 
    @sidebase/nuxt-auth: 0.4.2 => 0.4.2
    @tailwindcss/forms: ^0.5.3 => 0.5.3
    @trpc/client: ^10.12.0 => 10.12.0
    @trpc/server: ^10.12.0 => 10.12.0
    @types/node: ^18.14.0 => 18.14.0
    @vitejs/plugin-vue: ^4.0.0 => 4.0.0
    @vitest/coverage-c8: ^0.28.5 => 0.28.5
    @vue-macros/nuxt: ^1.1.2 => 1.1.2
    @vue/test-utils: ^2.3.0 => 2.3.0
    @vueuse/core: ^9.13.0 => 9.13.0
    @vueuse/nuxt: ^9.13.0 => 9.13.0
    browser-fs-access: ^0.32.1 => 0.32.1
    class-variance-authority: ^0.4.0 => 0.4.0
    dotenv: ^16.0.3 => 16.0.3
    eslint: ^8.34.0 => 8.34.0
    floating-vue: 2.0.0-beta.20 => 2.0.0-beta.20
    jsdom: ^21.1.0 => 21.1.0
    nanoid: ^4.0.1 => 4.0.1
    next-auth: 4.19.2 => 4.19.2
    node-ts: ^5.1.2 => 5.1.2
    nuxt-icon: ^0.3.2 => 0.3.2
    nuxt-vitest: ^0.6.6 => 0.6.6
    nuxt3:  3.2.3-rc.0-27949872.7479d46
    pinia: ^2.0.32 => 2.0.32
    prisma: ^4.10.1 => 4.10.1
    sass: ^1.58.3 => 1.58.3
    slugify: ^1.6.5 => 1.6.5
    superjson: ^1.12.2 => 1.12.2
    trpc-nuxt: ^0.7.0 => 0.7.0
    trpc-panel: ^1.2.8 => 1.2.8
    ts-node: ^10.9.1 => 10.9.1
    typescript: ^4.9.5 => 4.9.5
    vee-validate: ^4.7.4 => 4.7.4
    vitest: ^0.28.5 => 0.28.5
    vue-tsc: ^1.1.7 => 1.1.7
    zod: ^3.20.6 => 3.20.6

repo: https://github.com/cannap/recipes

Upvote & Fund

Fund with Polar

danielroe commented 1 year ago

Is this still happening for you?

cannap commented 1 year ago

Hi yes, updated deps today

cannap commented 1 year ago

Hi, sry for late response but i have now

image when i click on it "Cannot GET /_nuxt/vitest/"

danielroe commented 1 year ago

Would you provide a reproduction? 🙏

cannap commented 1 year ago

Would you provide a reproduction? 🙏

i will do today asap my current project has too much deps will create a new one

//e ok after a restart i got back to the old "doument is not deffined" error

cannap commented 1 year ago

ok found something new

// @vitest-environment nuxt when i add this to the file it works but i have set

image it will not work

i have now a call after the call i will create a repo

cannap commented 1 year ago

So here i forgot to add Vitest but here is the repo with the error

   https://github.com/cannap/nuxt-vitest-eyy8wd    npx vitest --ui  works fine

danielroe commented 1 year ago

you'll need to disable devtools on stackblitz

cannap commented 1 year ago

the problem is inside the devtools :D

image

when i add this to the test file "// @vitest-environment nuxt" it works in devtools