test: fix nuxt vitest

This commit is contained in:
YunYouJun
2023-11-06 02:26:45 +08:00
parent d3ab8fb2c1
commit 0232595083
10 changed files with 212 additions and 8 deletions

View File

@@ -50,9 +50,9 @@ function onClick(item: BottomMenuItem) {
:key="item.to" :key="item.to"
:item="item" :item="item"
:active="route.path === item.to" :active="route.path === item.to"
@click="onClick"
class="pt-3" class="pt-3"
style="backdrop-filter: blur(10px);" style="backdrop-filter: blur(10px);"
@click="onClick"
/> />
</YlfBottomMenu> </YlfBottomMenu>
</template> </template>

View File

@@ -1,5 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import { isClient } from '@vueuse/core'
import pkg from '~/package.json' import pkg from '~/package.json'
const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7) const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7)

View File

@@ -1,7 +1,7 @@
<template> <template>
<div text="center sm" my-3> <div text="center sm" my-3>
<CurrentVersion /> <CurrentVersion />
<div flex="~" justify-center items-center gap="2"> <div flex="~" items-center justify-center gap="2">
<a <a
href="https://github.com/YunYouJun/cook" target="_blank" href="https://github.com/YunYouJun/cook" target="_blank"
class="inline-flex items-center justify-center" class="inline-flex items-center justify-center"

View File

@@ -2,6 +2,7 @@ import { acceptHMRUpdate, defineStore } from 'pinia'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { defaultSettings } from '~/utils/settings' import { defaultSettings } from '~/utils/settings'
import { namespace } from '~/constants' import { namespace } from '~/constants'
import { ref } from 'vue'
export const useAppStore = defineStore('app', () => { export const useAppStore = defineStore('app', () => {
const deferredPrompt = ref<Event | any>() const deferredPrompt = ref<Event | any>()

View File

@@ -4,6 +4,7 @@ import { computed, onMounted, ref, watch } from 'vue'
import { useGtm } from '@gtm-support/vue-gtm' import { useGtm } from '@gtm-support/vue-gtm'
import { db } from '../../utils/db' import { db } from '../../utils/db'
import type { RecipeItem, StuffItem } from '~/types' import type { RecipeItem, StuffItem } from '~/types'
import { useAppStore } from './app'
const namespace = 'cook' const namespace = 'cook'

View File

@@ -15,6 +15,7 @@ export default defineNuxtConfig({
'@pinia/nuxt', '@pinia/nuxt',
'@nuxtjs/color-mode', '@nuxtjs/color-mode',
'@vite-pwa/nuxt', '@vite-pwa/nuxt',
'nuxt-vitest',
'@zadigetvoltaire/nuxt-gtm', '@zadigetvoltaire/nuxt-gtm',

View File

@@ -50,8 +50,10 @@
"dexie": "^3.2.4", "dexie": "^3.2.4",
"eslint": "^8.53.0", "eslint": "^8.53.0",
"fake-indexeddb": "^5.0.1", "fake-indexeddb": "^5.0.1",
"happy-dom": "^12.10.3",
"jsdom": "^22.1.0", "jsdom": "^22.1.0",
"nuxt": "^3.8.0", "nuxt": "^3.8.0",
"nuxt-vitest": "^0.11.2",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "^1.69.5", "sass": "^1.69.5",
"star-markdown-css": "^0.4.2", "star-markdown-css": "^0.4.2",

190
pnpm-lock.yaml generated
View File

@@ -85,12 +85,18 @@ devDependencies:
fake-indexeddb: fake-indexeddb:
specifier: ^5.0.1 specifier: ^5.0.1
version: 5.0.1 version: 5.0.1
happy-dom:
specifier: ^12.10.3
version: 12.10.3
jsdom: jsdom:
specifier: ^22.1.0 specifier: ^22.1.0
version: 22.1.0 version: 22.1.0
nuxt: nuxt:
specifier: ^3.8.0 specifier: ^3.8.0
version: 3.8.0(eslint@8.53.0)(rollup@2.79.1)(sass@1.69.5)(typescript@5.2.2)(vite@4.5.0)(vue-tsc@1.8.22) version: 3.8.0(eslint@8.53.0)(rollup@2.79.1)(sass@1.69.5)(typescript@5.2.2)(vite@4.5.0)(vue-tsc@1.8.22)
nuxt-vitest:
specifier: ^0.11.2
version: 0.11.2(@vitejs/plugin-vue-jsx@3.0.2)(@vitejs/plugin-vue@4.4.0)(happy-dom@12.10.3)(jsdom@22.1.0)(rollup@2.79.1)(vite@4.5.0)(vitest@0.34.6)(vue-router@4.2.5)(vue@3.3.7)
pinia: pinia:
specifier: ^2.1.7 specifier: ^2.1.7
version: 2.1.7(typescript@5.2.2)(vue@3.3.7) version: 2.1.7(typescript@5.2.2)(vue@3.3.7)
@@ -111,7 +117,7 @@ devDependencies:
version: 0.57.2(@unocss/webpack@0.57.2)(postcss@8.4.31)(rollup@2.79.1)(vite@4.5.0) version: 0.57.2(@unocss/webpack@0.57.2)(postcss@8.4.31)(rollup@2.79.1)(vite@4.5.0)
vitest: vitest:
specifier: ^0.34.6 specifier: ^0.34.6
version: 0.34.6(jsdom@22.1.0)(sass@1.69.5) version: 0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5)
vue-tsc: vue-tsc:
specifier: ^1.8.22 specifier: ^1.8.22
version: 1.8.22(typescript@5.2.2) version: 1.8.22(typescript@5.2.2)
@@ -2517,6 +2523,7 @@ packages:
dependencies: dependencies:
is-glob: 4.0.3 is-glob: 4.0.3
micromatch: 4.0.5 micromatch: 4.0.5
napi-wasm: 1.1.0
dev: true dev: true
bundledDependencies: bundledDependencies:
- napi-wasm - napi-wasm
@@ -3591,6 +3598,29 @@ packages:
tinyspy: 2.2.0 tinyspy: 2.2.0
dev: true dev: true
/@vitest/ui@0.33.0(vitest@0.34.6):
resolution: {integrity: sha512-7gbAjLqt30R4bodkJAutdpy4ncv+u5IKTHYTow1c2q+FOxZUC9cKOSqMUxjwaaTwLN+EnDnmXYPtg3CoahaUzQ==}
peerDependencies:
vitest: '>=0.30.1 <1'
dependencies:
'@vitest/utils': 0.33.0
fast-glob: 3.3.1
fflate: 0.8.1
flatted: 3.2.9
pathe: 1.1.1
picocolors: 1.0.0
sirv: 2.0.3
vitest: 0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5)
dev: true
/@vitest/utils@0.33.0:
resolution: {integrity: sha512-pF1w22ic965sv+EN6uoePkAOTkAPWM03Ri/jXNyMIKBb/XHLDPfhLvf/Fa9g0YECevAIz56oVYXhodLvLQ/awA==}
dependencies:
diff-sequences: 29.6.3
loupe: 2.3.7
pretty-format: 29.7.0
dev: true
/@vitest/utils@0.34.6: /@vitest/utils@0.34.6:
resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==}
dependencies: dependencies:
@@ -4313,6 +4343,11 @@ packages:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: true dev: true
/base64-arraybuffer-es6@0.7.0:
resolution: {integrity: sha512-ESyU/U1CFZDJUdr+neHRhNozeCv72Y7Vm0m1DCbjX3KBjT6eYocvAJlSk6+8+HkVwXlT1FNxhGW6q3UKAlCvvw==}
engines: {node: '>=6.0.0'}
dev: true
/big-integer@1.6.51: /big-integer@1.6.51:
resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==}
engines: {node: '>=0.6'} engines: {node: '>=0.6'}
@@ -4804,6 +4839,10 @@ packages:
engines: {node: '>= 6'} engines: {node: '>= 6'}
dev: true dev: true
/css.escape@1.5.1:
resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
dev: true
/cssesc@3.0.0: /cssesc@3.0.0:
resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
engines: {node: '>=4'} engines: {node: '>=4'}
@@ -5097,6 +5136,12 @@ packages:
resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
dev: true dev: true
/domexception@1.0.1:
resolution: {integrity: sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==}
dependencies:
webidl-conversions: 4.0.2
dev: true
/domexception@4.0.0: /domexception@4.0.0:
resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==}
engines: {node: '>=12'} engines: {node: '>=12'}
@@ -5649,7 +5694,7 @@ packages:
'@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2)
'@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2)
eslint: 8.53.0 eslint: 8.53.0
vitest: 0.34.6(jsdom@22.1.0)(sass@1.69.5) vitest: 0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
- typescript - typescript
@@ -5881,6 +5926,12 @@ packages:
ufo: 1.3.1 ufo: 1.3.1
dev: true dev: true
/fake-indexeddb@4.0.2:
resolution: {integrity: sha512-SdTwEhnakbgazc7W3WUXOJfGmhH0YfG4d+dRPOFoYDRTL6U5t8tvrmkf2W/C3W1jk2ylV7Wrnj44RASqpX/lEw==}
dependencies:
realistic-structured-clone: 3.0.0
dev: true
/fake-indexeddb@5.0.1: /fake-indexeddb@5.0.1:
resolution: {integrity: sha512-vxybH29Owtc6khV/Usy47B1g+eKwyhFiX8nwpCC4td320jvwrKQDH6vNtcJZgUzVxmfsSIlHzLKQzT76JMCO7A==} resolution: {integrity: sha512-vxybH29Owtc6khV/Usy47B1g+eKwyhFiX8nwpCC4td320jvwrKQDH6vNtcJZgUzVxmfsSIlHzLKQzT76JMCO7A==}
engines: {node: '>=18'} engines: {node: '>=18'}
@@ -5919,6 +5970,10 @@ packages:
reusify: 1.0.4 reusify: 1.0.4
dev: true dev: true
/fflate@0.8.1:
resolution: {integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==}
dev: true
/file-entry-cache@6.0.1: /file-entry-cache@6.0.1:
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
engines: {node: ^10.12.0 || >=12.0.0} engines: {node: ^10.12.0 || >=12.0.0}
@@ -6314,6 +6369,17 @@ packages:
unenv: 1.7.4 unenv: 1.7.4
dev: true dev: true
/happy-dom@12.10.3:
resolution: {integrity: sha512-JzUXOh0wdNGY54oKng5hliuBkq/+aT1V3YpTM+lrN/GoLQTANZsMaIvmHiHe612rauHvPJnDZkZ+5GZR++1Abg==}
dependencies:
css.escape: 1.5.1
entities: 4.5.0
iconv-lite: 0.6.3
webidl-conversions: 7.0.0
whatwg-encoding: 2.0.0
whatwg-mimetype: 3.0.0
dev: true
/has-bigints@1.0.2: /has-bigints@1.0.2:
resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
dev: true dev: true
@@ -7545,6 +7611,10 @@ packages:
hasBin: true hasBin: true
dev: true dev: true
/napi-wasm@1.1.0:
resolution: {integrity: sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==}
dev: true
/natural-compare-lite@1.4.0: /natural-compare-lite@1.4.0:
resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
dev: true dev: true
@@ -7854,6 +7924,36 @@ packages:
fsevents: 2.3.3 fsevents: 2.3.3
dev: true dev: true
/nuxt-vitest@0.11.2(@vitejs/plugin-vue-jsx@3.0.2)(@vitejs/plugin-vue@4.4.0)(happy-dom@12.10.3)(jsdom@22.1.0)(rollup@2.79.1)(vite@4.5.0)(vitest@0.34.6)(vue-router@4.2.5)(vue@3.3.7):
resolution: {integrity: sha512-iPMpkMAUeQcpIdKvL6NrH0xmHF87V6ztbAKypxqNXNbxYVbqHylJvwPqFGf9hbTGQWpKScb+71/ISt21JgUt/Q==}
peerDependencies:
'@vitejs/plugin-vue': '*'
'@vitejs/plugin-vue-jsx': '*'
vite: '*'
vitest: ^0.24.5 || ^0.26.0 || ^0.27.0 || ^0.28.0 || ^0.29.0 || ^0.30.0 || ^0.33.0
dependencies:
'@nuxt/kit': 3.8.0(rollup@2.79.1)
'@vitejs/plugin-vue': 4.4.0(vite@4.5.0)(vue@3.3.7)
'@vitejs/plugin-vue-jsx': 3.0.2(vite@4.5.0)(vue@3.3.7)
'@vitest/ui': 0.33.0(vitest@0.34.6)
defu: 6.1.3
get-port-please: 3.1.1
perfect-debounce: 1.0.0
std-env: 3.4.3
vite: 4.5.0(@types/node@20.8.10)(sass@1.69.5)
vitest: 0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5)
vitest-environment-nuxt: 0.11.2(happy-dom@12.10.3)(jsdom@22.1.0)(rollup@2.79.1)(vitest@0.34.6)(vue-router@4.2.5)(vue@3.3.7)
transitivePeerDependencies:
- '@testing-library/vue'
- '@vue/server-renderer'
- happy-dom
- jsdom
- rollup
- supports-color
- vue
- vue-router
dev: true
/nuxt@3.8.0(eslint@8.53.0)(rollup@2.79.1)(sass@1.69.5)(typescript@5.2.2)(vite@4.5.0)(vue-tsc@1.8.22): /nuxt@3.8.0(eslint@8.53.0)(rollup@2.79.1)(sass@1.69.5)(typescript@5.2.2)(vite@4.5.0)(vue-tsc@1.8.22):
resolution: {integrity: sha512-ZnisJYx5AcUl7xlw18m6zfINBpNhld+ZF+jdTLRZxkLjKSFZeFMGqKxOR1jNVSmxfIXM/guK0uV9GPm6HK/z7g==} resolution: {integrity: sha512-ZnisJYx5AcUl7xlw18m6zfINBpNhld+ZF+jdTLRZxkLjKSFZeFMGqKxOR1jNVSmxfIXM/guK0uV9GPm6HK/z7g==}
engines: {node: ^14.18.0 || >=16.10.0} engines: {node: ^14.18.0 || >=16.10.0}
@@ -8850,6 +8950,14 @@ packages:
dependencies: dependencies:
picomatch: 2.3.1 picomatch: 2.3.1
/realistic-structured-clone@3.0.0:
resolution: {integrity: sha512-rOjh4nuWkAqf9PWu6JVpOWD4ndI+JHfgiZeMmujYcPi+fvILUu7g6l26TC1K5aBIp34nV+jE1cDO75EKOfHC5Q==}
dependencies:
domexception: 1.0.1
typeson: 6.1.0
typeson-registry: 1.0.0-alpha.39
dev: true
/redis-errors@1.2.0: /redis-errors@1.2.0:
resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==}
engines: {node: '>=4'} engines: {node: '>=4'}
@@ -9755,6 +9863,13 @@ packages:
punycode: 2.3.1 punycode: 2.3.1
dev: true dev: true
/tr46@2.1.0:
resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==}
engines: {node: '>=8'}
dependencies:
punycode: 2.3.1
dev: true
/tr46@4.1.1: /tr46@4.1.1:
resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==}
engines: {node: '>=14'} engines: {node: '>=14'}
@@ -9882,6 +9997,20 @@ packages:
engines: {node: '>=14.17'} engines: {node: '>=14.17'}
hasBin: true hasBin: true
/typeson-registry@1.0.0-alpha.39:
resolution: {integrity: sha512-NeGDEquhw+yfwNhguLPcZ9Oj0fzbADiX4R0WxvoY8nGhy98IbzQy1sezjoEFWOywOboj/DWehI+/aUlRVrJnnw==}
engines: {node: '>=10.0.0'}
dependencies:
base64-arraybuffer-es6: 0.7.0
typeson: 6.1.0
whatwg-url: 8.7.0
dev: true
/typeson@6.1.0:
resolution: {integrity: sha512-6FTtyGr8ldU0pfbvW/eOZrEtEkczHRUtduBnA90Jh9kMPCiFNnXIon3vF41N0S4tV1HHQt4Hk1j4srpESziCaA==}
engines: {node: '>=0.1.14'}
dev: true
/ufo@1.3.1: /ufo@1.3.1:
resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==}
dev: true dev: true
@@ -10457,7 +10586,47 @@ packages:
fsevents: 2.3.3 fsevents: 2.3.3
dev: true dev: true
/vitest@0.34.6(jsdom@22.1.0)(sass@1.69.5): /vitest-environment-nuxt@0.11.2(happy-dom@12.10.3)(jsdom@22.1.0)(rollup@2.79.1)(vitest@0.34.6)(vue-router@4.2.5)(vue@3.3.7):
resolution: {integrity: sha512-/X3l1nGZ6CX4mZx1kYm2aBl8DPG+JqU2OXSHvd8CM+6XTdt2Ap/KglkL7yMtAo8zgKHEwuVFzeZjOfEhnQyv8w==}
peerDependencies:
'@testing-library/vue': 7.0.0
happy-dom: ^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0
jsdom: ^22.0.0
vitest: ^0.24.5 || ^0.26.0 || ^0.27.0 || ^0.28.0 || ^0.29.0 || ^0.30.0 || ^0.33.0
vue: ^3.2.45
vue-router: ^4.0.0
peerDependenciesMeta:
'@testing-library/vue':
optional: true
happy-dom:
optional: true
jsdom:
optional: true
dependencies:
'@nuxt/kit': 3.8.0(rollup@2.79.1)
'@vue/test-utils': 2.4.1(vue@3.3.7)
defu: 6.1.3
estree-walker: 3.0.3
fake-indexeddb: 4.0.2
h3: 1.8.2
happy-dom: 12.10.3
jsdom: 22.1.0
local-pkg: 0.5.0
magic-string: 0.30.5
ofetch: 1.3.3
radix3: 1.1.0
ufo: 1.3.1
unenv: 1.7.4
vitest: 0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5)
vue: 3.3.7(typescript@5.2.2)
vue-router: 4.2.5(vue@3.3.7)
transitivePeerDependencies:
- '@vue/server-renderer'
- rollup
- supports-color
dev: true
/vitest@0.34.6(happy-dom@12.10.3)(jsdom@22.1.0)(sass@1.69.5):
resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==}
engines: {node: '>=v14.18.0'} engines: {node: '>=v14.18.0'}
hasBin: true hasBin: true
@@ -10501,6 +10670,7 @@ packages:
cac: 6.7.14 cac: 6.7.14
chai: 4.3.10 chai: 4.3.10
debug: 4.3.4 debug: 4.3.4
happy-dom: 12.10.3
jsdom: 22.1.0 jsdom: 22.1.0
local-pkg: 0.4.3 local-pkg: 0.4.3
magic-string: 0.30.5 magic-string: 0.30.5
@@ -10685,6 +10855,11 @@ packages:
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
dev: true dev: true
/webidl-conversions@6.1.0:
resolution: {integrity: sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==}
engines: {node: '>=10.4'}
dev: true
/webidl-conversions@7.0.0: /webidl-conversions@7.0.0:
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'} engines: {node: '>=12'}
@@ -10774,6 +10949,15 @@ packages:
webidl-conversions: 4.0.2 webidl-conversions: 4.0.2
dev: true dev: true
/whatwg-url@8.7.0:
resolution: {integrity: sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==}
engines: {node: '>=10'}
dependencies:
lodash: 4.17.21
tr46: 2.1.0
webidl-conversions: 6.1.0
dev: true
/which-boxed-primitive@1.0.2: /which-boxed-primitive@1.0.2:
resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
dependencies: dependencies:

View File

@@ -4,10 +4,16 @@ export default defineConfig({
test: { test: {
include: ['test/**/*.test.ts'], include: ['test/**/*.test.ts'],
environment: 'jsdom', environment: 'jsdom',
deps: { server: {
inline: ['@vue', '@vueuse', 'vue-demi'], deps: {
inline: ['@vue', '@vueuse', 'vue-demi'],
},
}, },
setupFiles: ['test/setup.ts'], setupFiles: ['test/setup.ts'],
alias: {
'~': './',
}
}, },
}) })

10
vitest.nuxt.config.ts Normal file
View File

@@ -0,0 +1,10 @@
import { defineVitestConfig } from 'nuxt-vitest/config'
export default defineVitestConfig({
test: {
include: ['test/**/*.test.ts'],
environment: 'nuxt',
setupFiles: ['test/setup.ts'],
},
})