diff --git a/package.json b/package.json index efe5f133..804f63d0 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@nuxt/eslint-config": "^0.2.0", "@nuxt/kit": "^3.8.0", "@nuxt/schema": "^3.8.0", + "@nuxt/test-utils": "^3.8.1", "@types/http-proxy": "^1.17.13", "@types/node": "^20.8.10", "@types/semver": "^7.5.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fab0404a..47dc1767 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,6 +19,9 @@ devDependencies: '@nuxt/schema': specifier: ^3.8.0 version: 3.8.0(rollup@3.29.4) + '@nuxt/test-utils': + specifier: ^3.8.1 + version: 3.8.1(rollup@3.29.4)(vue@3.3.4) '@types/http-proxy': specifier: ^1.17.13 version: 1.17.13 @@ -1282,6 +1285,33 @@ packages: - supports-color dev: true + /@nuxt/kit@3.8.1(rollup@3.29.4): + resolution: {integrity: sha512-DrhG1Z85iH68QOTkgfb0HVfM2g7+CfcMWrFWMDwck9ofyM2RXQUZyfmvMedwBnui1AjjpgpLO9078yZM+RqNUg==} + engines: {node: ^14.18.0 || >=16.10.0} + dependencies: + '@nuxt/schema': 3.8.1(rollup@3.29.4) + c12: 1.5.1 + consola: 3.2.3 + defu: 6.1.3 + globby: 13.2.2 + hash-sum: 2.0.0 + ignore: 5.2.4 + jiti: 1.21.0 + knitwork: 1.0.0 + mlly: 1.4.2 + pathe: 1.1.1 + pkg-types: 1.0.3 + scule: 1.0.0 + semver: 7.5.4 + ufo: 1.3.1 + unctx: 2.3.1 + unimport: 3.4.0(rollup@3.29.4) + untyped: 1.4.0 + transitivePeerDependencies: + - rollup + - supports-color + dev: true + /@nuxt/schema@3.8.0(rollup@3.29.4): resolution: {integrity: sha512-VEDVeCjdVowhoY5vIBSz94+SSwmM204jN6TNe/ShBJ2d/vZiy9EtLbhOwqaPNFHwnN1fl/XFHThwJiexdB9D1w==} engines: {node: ^14.18.0 || >=16.10.0} @@ -1302,6 +1332,25 @@ packages: - supports-color dev: true + /@nuxt/schema@3.8.1(rollup@3.29.4): + resolution: {integrity: sha512-fSaWRcI/2mUskfTZTGSnH6Ny0x05CRzylbVn6WFV0d6UEKIVy42Qd6n+h7yoFfp4cq4nji6u16PT4SqS1DEhsw==} + engines: {node: ^14.18.0 || >=16.10.0} + dependencies: + '@nuxt/ui-templates': 1.3.1 + consola: 3.2.3 + defu: 6.1.3 + hookable: 5.5.3 + pathe: 1.1.1 + pkg-types: 1.0.3 + std-env: 3.4.3 + ufo: 1.3.1 + unimport: 3.4.0(rollup@3.29.4) + untyped: 1.4.0 + transitivePeerDependencies: + - rollup + - supports-color + dev: true + /@nuxt/telemetry@2.5.2(rollup@3.29.4): resolution: {integrity: sha512-kZ+rWq/5MZonMhp8KGFI5zMaR2VsiWpnlkOLJIuIX2WoJl0DkHvtxCtuFq2erAqMVruWLpKU+tgMC+1cno/QmA==} hasBin: true @@ -1328,6 +1377,37 @@ packages: - supports-color dev: true + /@nuxt/test-utils@3.8.1(rollup@3.29.4)(vue@3.3.4): + resolution: {integrity: sha512-8ZQ+OZ7z5Sc5KG2aCvk0piheYSpGb2UQJMCWr8ORwEyZIw4awrkkwGzUY06e344E4StvJB8zxN122MEcFNOkow==} + engines: {node: ^14.18.0 || >=16.10.0} + peerDependencies: + '@jest/globals': ^29.5.0 + playwright-core: ^1.34.3 + vitest: ^0.30.0 || ^0.31.0 || ^0.32.0 || ^0.33.0 + vue: ^3.3.4 + peerDependenciesMeta: + '@jest/globals': + optional: true + playwright-core: + optional: true + vitest: + optional: true + dependencies: + '@nuxt/kit': 3.8.1(rollup@3.29.4) + '@nuxt/schema': 3.8.1(rollup@3.29.4) + consola: 3.2.3 + defu: 6.1.3 + execa: 8.0.1 + get-port-please: 3.1.1 + ofetch: 1.3.3 + pathe: 1.1.1 + ufo: 1.3.1 + vue: 3.3.4 + transitivePeerDependencies: + - rollup + - supports-color + dev: true + /@nuxt/ui-templates@1.3.1: resolution: {integrity: sha512-5gc02Pu1HycOVUWJ8aYsWeeXcSTPe8iX8+KIrhyEtEoOSkY0eMBuo0ssljB8wALuEmepv31DlYe5gpiRwkjESA==} dev: true @@ -2958,6 +3038,10 @@ packages: resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} dev: true + /defu@6.1.3: + resolution: {integrity: sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==} + dev: true + /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: true diff --git a/src/commands/test.ts b/src/commands/test.ts index 2b4460c7..e50a51af 100644 --- a/src/commands/test.ts +++ b/src/commands/test.ts @@ -31,7 +31,7 @@ export default defineCommand({ const { runTests } = await importTestUtils() await runTests({ - cwd, + rootDir: cwd, dev: ctx.args.dev, watch: ctx.args.watch, .../*ctx.options ||*/ {}, @@ -39,7 +39,6 @@ export default defineCommand({ }, }) -// @ts-ignore TODO async function importTestUtils(): Promise { let err for (const pkg of [