diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d573b00e..654badab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: corepack enable - uses: actions/setup-node@v3 with: @@ -32,7 +32,7 @@ jobs: matrix: node-version: [ 16, 18 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: corepack enable - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2ce765cb..aef3252b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/packages/vitest-environment-nuxt/package.json b/packages/vitest-environment-nuxt/package.json index a04593b1..d415191b 100644 --- a/packages/vitest-environment-nuxt/package.json +++ b/packages/vitest-environment-nuxt/package.json @@ -60,13 +60,13 @@ "devDependencies": { "@testing-library/vue": "7.0.0", "@types/jsdom": "21.1.2", - "happy-dom": "10.11.1", + "happy-dom": "11.0.2", "jsdom": "22.1.0", "vue": "3.3.4" }, "peerDependencies": { "@testing-library/vue": "7.0.0", - "happy-dom": "^9.10.9 || ^10.0.0", + "happy-dom": "^9.10.9 || ^10.0.0 || ^11.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", diff --git a/packages/vitest-environment-nuxt/src/runtime/render.ts b/packages/vitest-environment-nuxt/src/runtime/render.ts index 1f36837a..85ad9dbf 100644 --- a/packages/vitest-environment-nuxt/src/runtime/render.ts +++ b/packages/vitest-environment-nuxt/src/runtime/render.ts @@ -5,10 +5,8 @@ import { h, nextTick, } from 'vue' - -import { - type RenderOptions as TestingLibraryRenderOptions, - render as renderFromTestingLibrary, +import type { + RenderOptions as TestingLibraryRenderOptions, } from '@testing-library/vue' import { defu } from 'defu' import type { RouteLocationRaw } from 'vue-router' @@ -68,6 +66,8 @@ export async function renderSuspended( ..._options } = options || {} + const { render : renderFromTestingLibrary } = await import('@testing-library/vue') + // @ts-ignore untyped global __unctx__ const { vueApp } = globalThis.__unctx__.get('nuxt-app').tryUse() const { render, setup } = component as DefineComponent diff --git a/playground/package.json b/playground/package.json index f19bc3c5..dbaa966a 100644 --- a/playground/package.json +++ b/playground/package.json @@ -16,13 +16,13 @@ "devDependencies": { "@nuxt/devtools": "0.8.2", "@testing-library/vue": "7.0.0", - "happy-dom": "10.11.1", + "happy-dom": "11.0.2", "jsdom": "22.1.0", "nuxt": "3.7.1", - "nuxt-vitest": "0.10.2", + "nuxt-vitest": "0.10.4", "typescript": "5.2.2", "vitest": "0.33.0", - "vitest-environment-nuxt": "0.10.2", + "vitest-environment-nuxt": "0.10.4", "vue-tsc": "1.8.8" }, "version": "0.10.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index addcbca3..43384bb7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,7 +55,7 @@ importers: version: 2.0.0(typescript@5.2.2) vitest: specifier: 0.33.0 - version: 0.33.0(happy-dom@10.11.1)(jsdom@22.1.0) + version: 0.33.0(happy-dom@11.0.2)(jsdom@22.1.0) vue: specifier: 3.3.4 version: 3.3.4 @@ -143,7 +143,7 @@ importers: version: 1.7.4 vitest: specifier: ^0.24.5 || ^0.26.0 || ^0.27.0 || ^0.28.0 || ^0.29.0 || ^0.30.0 || ^0.33.0 - version: 0.33.0(happy-dom@10.11.1)(jsdom@22.1.0) + version: 0.33.0(happy-dom@11.0.2)(jsdom@22.1.0) vue-router: specifier: ^4.0.0 version: 4.2.4(vue@3.3.4) @@ -155,8 +155,8 @@ importers: specifier: 21.1.2 version: 21.1.2 happy-dom: - specifier: 10.11.1 - version: 10.11.1 + specifier: 11.0.2 + version: 11.0.2 jsdom: specifier: 22.1.0 version: 22.1.0 @@ -173,8 +173,8 @@ importers: specifier: 7.0.0 version: 7.0.0(@vue/compiler-sfc@3.3.4)(vue@3.3.4) happy-dom: - specifier: 10.11.1 - version: 10.11.1 + specifier: 11.0.2 + version: 11.0.2 jsdom: specifier: 22.1.0 version: 22.1.0 @@ -189,7 +189,7 @@ importers: version: 5.2.2 vitest: specifier: 0.33.0 - version: 0.33.0(happy-dom@10.11.1)(jsdom@22.1.0) + version: 0.33.0(happy-dom@11.0.2)(jsdom@22.1.0) vitest-environment-nuxt: specifier: workspace:* version: link:../packages/vitest-environment-nuxt @@ -2118,7 +2118,7 @@ packages: std-env: 3.4.3 test-exclude: 6.0.0 v8-to-istanbul: 9.1.0 - vitest: 0.33.0(happy-dom@10.11.1)(jsdom@22.1.0) + vitest: 0.33.0(happy-dom@11.0.2)(jsdom@22.1.0) transitivePeerDependencies: - supports-color dev: true @@ -2801,7 +2801,7 @@ packages: dotenv: 16.3.1 giget: 1.1.2 jiti: 1.19.3 - mlly: 1.4.1 + mlly: 1.4.2 ohash: 1.1.3 pathe: 1.1.1 perfect-debounce: 1.0.0 @@ -4422,8 +4422,8 @@ packages: uncrypto: 0.1.3 unenv: 1.7.4 - /happy-dom@10.11.1: - resolution: {integrity: sha512-5Aeg19sIaq5/+T6wH0skohsY223D9Mx32AsNOldd5VHqvQsE+xiqB54Q30RcyUxZSaUZF39WpmjF0SrDCBOi8g==} + /happy-dom@11.0.2: + resolution: {integrity: sha512-0yyYIBCByZVgWNuM+/tXXaAR+YUjsoXmzDisQ/KPI7Dt9kXtsPUOU6JAc/isVxridmeSb9/icthsaAhUBKJa4g==} dependencies: css.escape: 1.5.1 entities: 4.5.0 @@ -8220,7 +8220,7 @@ packages: - supports-color - terser - /vitest@0.33.0(happy-dom@10.11.1)(jsdom@22.1.0): + /vitest@0.33.0(happy-dom@11.0.2)(jsdom@22.1.0): resolution: {integrity: sha512-1CxaugJ50xskkQ0e969R/hW47za4YXDUfWJDxip1hwbnhUjYolpfUn2AMOulqG/Dtd9WYAtkHmM/m3yKVrEejQ==} engines: {node: '>=v14.18.0'} hasBin: true @@ -8264,7 +8264,7 @@ packages: cac: 6.7.14 chai: 4.3.8 debug: 4.3.4 - happy-dom: 10.11.1 + happy-dom: 11.0.2 jsdom: 22.1.0 local-pkg: 0.4.3 magic-string: 0.30.3