@nuxt/test-utils 3.14.1 → 3.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vite from 'vite';
2
2
  import { InlineConfig } from 'vite';
3
3
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
4
- import { InlineConfig as InlineConfig$1 } from 'vitest';
4
+ import { InlineConfig as InlineConfig$1 } from 'vitest/node';
5
5
  import { DotenvOptions } from 'c12';
6
6
 
7
7
  interface GetVitestConfigOptions {
package/dist/config.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vite from 'vite';
2
2
  import { InlineConfig } from 'vite';
3
3
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
4
- import { InlineConfig as InlineConfig$1 } from 'vitest';
4
+ import { InlineConfig as InlineConfig$1 } from 'vitest/node';
5
5
  import { DotenvOptions } from 'c12';
6
6
 
7
7
  interface GetVitestConfigOptions {
package/dist/config.mjs CHANGED
@@ -81,6 +81,7 @@ async function startNuxtAndGetViteConfig(rootDir = process.cwd(), options = {})
81
81
  }
82
82
  const excludedPlugins = [
83
83
  "nuxt:import-protection",
84
+ "nuxt:import-conditions",
84
85
  "vite-plugin-checker"
85
86
  ];
86
87
  async function getVitestConfigFromNuxt(options, loadNuxtOptions = {}) {
package/dist/e2e.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.CyoO8zI7.mjs';
2
- export { $ as $fetch, G as GotoOptions, S as StartServerOptions, h as TestRunner, c as createBrowser, d as createPage, f as fetch, g as getBrowser, s as startServer, e as stopServer, u as url, w as waitForHydration } from './shared/test-utils.CyoO8zI7.mjs';
1
+ import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.C0h0-xb8.mjs';
2
+ export { $ as $fetch, G as GotoOptions, S as StartServerOptions, h as TestRunner, c as createBrowser, d as createPage, f as fetch, g as getBrowser, s as startServer, e as stopServer, u as url, w as waitForHydration } from './shared/test-utils.C0h0-xb8.mjs';
3
3
  import { LogType } from 'consola';
4
4
  import 'playwright-core';
5
5
  import '@nuxt/schema';
6
- import 'execa';
6
+ import 'tinyexec';
7
7
 
8
8
  declare function createTestContext(options: Partial<TestOptions>): TestContext;
9
9
  declare function useTestContext(): TestContext;
package/dist/e2e.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.CyoO8zI7.js';
2
- export { $ as $fetch, G as GotoOptions, S as StartServerOptions, h as TestRunner, c as createBrowser, d as createPage, f as fetch, g as getBrowser, s as startServer, e as stopServer, u as url, w as waitForHydration } from './shared/test-utils.CyoO8zI7.js';
1
+ import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.C0h0-xb8.js';
2
+ export { $ as $fetch, G as GotoOptions, S as StartServerOptions, h as TestRunner, c as createBrowser, d as createPage, f as fetch, g as getBrowser, s as startServer, e as stopServer, u as url, w as waitForHydration } from './shared/test-utils.C0h0-xb8.js';
3
3
  import { LogType } from 'consola';
4
4
  import 'playwright-core';
5
5
  import '@nuxt/schema';
6
- import 'execa';
6
+ import 'tinyexec';
7
7
 
8
8
  declare function createTestContext(options: Partial<TestOptions>): TestContext;
9
9
  declare function useTestContext(): TestContext;
package/dist/e2e.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { d as distDir } from './shared/test-utils.BZS9cHDP.mjs';
2
- export { b as buildFixture, c as createBrowser, a as createPage, e as createTest, g as getBrowser, l as loadFixture, f as setup, s as setupMaps, w as waitForHydration } from './shared/test-utils.BZS9cHDP.mjs';
3
- import { u as useTestContext } from './shared/test-utils.BumFEtZ8.mjs';
4
- export { $ as $fetch, c as createTestContext, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv, s as setTestContext, a as startServer, b as stopServer, d as url } from './shared/test-utils.BumFEtZ8.mjs';
1
+ import { d as distDir } from './shared/test-utils.CaqvQLs_.mjs';
2
+ export { b as buildFixture, c as createBrowser, a as createPage, e as createTest, g as getBrowser, l as loadFixture, f as setup, s as setupMaps, w as waitForHydration } from './shared/test-utils.CaqvQLs_.mjs';
3
+ import { u as useTestContext } from './shared/test-utils.ClQ9CUdo.mjs';
4
+ export { $ as $fetch, c as createTestContext, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv, s as setTestContext, a as startServer, b as stopServer, d as url } from './shared/test-utils.ClQ9CUdo.mjs';
5
5
  import { consola } from 'consola';
6
6
  import { resolve } from 'pathe';
7
7
  import 'node:fs';
@@ -9,7 +9,7 @@ import 'node:path';
9
9
  import 'defu';
10
10
  import '@nuxt/kit';
11
11
  import 'node:url';
12
- import 'execa';
12
+ import 'tinyexec';
13
13
  import 'get-port-please';
14
14
  import 'ofetch';
15
15
  import 'ufo';
@@ -1,7 +1,7 @@
1
1
  import { resolve } from 'pathe';
2
2
  import { stringifyQuery } from 'ufo';
3
- import { $ as $fetch, u as useTestContext } from './shared/test-utils.BumFEtZ8.mjs';
4
- import 'execa';
3
+ import { $ as $fetch, u as useTestContext } from './shared/test-utils.ClQ9CUdo.mjs';
4
+ import 'tinyexec';
5
5
  import 'get-port-please';
6
6
  import 'ofetch';
7
7
  import '@nuxt/kit';
package/dist/module.d.mts CHANGED
@@ -6,6 +6,6 @@ interface NuxtVitestOptions {
6
6
  logToConsole?: boolean;
7
7
  vitestConfig?: UserConfig;
8
8
  }
9
- declare const _default: _nuxt_schema.NuxtModule<NuxtVitestOptions>;
9
+ declare const _default: _nuxt_schema.NuxtModule<NuxtVitestOptions, NuxtVitestOptions, false>;
10
10
 
11
11
  export { type NuxtVitestOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -6,6 +6,6 @@ interface NuxtVitestOptions {
6
6
  logToConsole?: boolean;
7
7
  vitestConfig?: UserConfig;
8
8
  }
9
- declare const _default: _nuxt_schema.NuxtModule<NuxtVitestOptions>;
9
+ declare const _default: _nuxt_schema.NuxtModule<NuxtVitestOptions, NuxtVitestOptions, false>;
10
10
 
11
11
  export { type NuxtVitestOptions, _default as default };
@@ -1,9 +1,9 @@
1
1
  import * as _playwright_test from '@playwright/test';
2
2
  export { expect } from '@playwright/test';
3
3
  import { Response } from 'playwright-core';
4
- import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.CyoO8zI7.mjs';
4
+ import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.C0h0-xb8.mjs';
5
5
  import '@nuxt/schema';
6
- import 'execa';
6
+ import 'tinyexec';
7
7
 
8
8
  type ConfigOptions = {
9
9
  nuxt: Partial<TestOptions$1> | undefined;
@@ -1,9 +1,9 @@
1
1
  import * as _playwright_test from '@playwright/test';
2
2
  export { expect } from '@playwright/test';
3
3
  import { Response } from 'playwright-core';
4
- import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.CyoO8zI7.js';
4
+ import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.C0h0-xb8.js';
5
5
  import '@nuxt/schema';
6
- import 'execa';
6
+ import 'tinyexec';
7
7
 
8
8
  type ConfigOptions = {
9
9
  nuxt: Partial<TestOptions$1> | undefined;
@@ -1,16 +1,16 @@
1
1
  import { test as test$1 } from '@playwright/test';
2
2
  export { expect } from '@playwright/test';
3
- import { e as createTest, w as waitForHydration } from './shared/test-utils.BZS9cHDP.mjs';
3
+ import { e as createTest, w as waitForHydration } from './shared/test-utils.CaqvQLs_.mjs';
4
4
  import 'node:path';
5
5
  import 'defu';
6
6
  import 'ufo';
7
7
  import 'consola';
8
8
  import 'node:fs';
9
9
  import '@nuxt/kit';
10
- import { d as url } from './shared/test-utils.BumFEtZ8.mjs';
10
+ import { d as url } from './shared/test-utils.ClQ9CUdo.mjs';
11
11
  import 'pathe';
12
12
  import 'node:url';
13
- import 'execa';
13
+ import 'tinyexec';
14
14
  import 'get-port-please';
15
15
  import 'ofetch';
16
16
 
@@ -1,4 +1,4 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
2
  [key: string]: any;
3
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
3
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
4
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { Browser, BrowserContextOptions, Page, Response as Response$1, LaunchOptions } from 'playwright-core';
2
2
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
3
- import { ExecaChildProcess } from 'execa';
3
+ import { exec } from 'tinyexec';
4
4
 
5
5
  declare function createBrowser(): Promise<void>;
6
6
  declare function getBrowser(): Promise<Browser>;
@@ -90,7 +90,7 @@ interface TestContext {
90
90
  nuxt?: Nuxt;
91
91
  browser?: Browser;
92
92
  url?: string;
93
- serverProcess?: ExecaChildProcess;
93
+ serverProcess?: ReturnType<typeof exec>;
94
94
  mockFn?: (...args: unknown[]) => unknown;
95
95
  /**
96
96
  * Functions to run on the vitest `afterAll` hook.
@@ -1,6 +1,6 @@
1
1
  import { Browser, BrowserContextOptions, Page, Response as Response$1, LaunchOptions } from 'playwright-core';
2
2
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
3
- import { ExecaChildProcess } from 'execa';
3
+ import { exec } from 'tinyexec';
4
4
 
5
5
  declare function createBrowser(): Promise<void>;
6
6
  declare function getBrowser(): Promise<Browser>;
@@ -90,7 +90,7 @@ interface TestContext {
90
90
  nuxt?: Nuxt;
91
91
  browser?: Browser;
92
92
  url?: string;
93
- serverProcess?: ExecaChildProcess;
93
+ serverProcess?: ReturnType<typeof exec>;
94
94
  mockFn?: (...args: unknown[]) => unknown;
95
95
  /**
96
96
  * Functions to run on the vitest `afterAll` hook.
@@ -1,4 +1,4 @@
1
- import { u as useTestContext, d as url, c as createTestContext, s as setTestContext, b as stopServer, a as startServer } from './test-utils.BumFEtZ8.mjs';
1
+ import { u as useTestContext, d as url, c as createTestContext, s as setTestContext, b as stopServer, a as startServer } from './test-utils.ClQ9CUdo.mjs';
2
2
  import { existsSync, promises } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
4
  import { defu } from 'defu';
@@ -1,4 +1,4 @@
1
- import { execa } from 'execa';
1
+ import { exec } from 'tinyexec';
2
2
  import { getRandomPort, waitForPort } from 'get-port-please';
3
3
  import { fetch as fetch$1, $fetch as $fetch$1 } from 'ofetch';
4
4
  import * as _kit from '@nuxt/kit';
@@ -74,18 +74,20 @@ async function startServer(options = {}) {
74
74
  ctx.url = `http://${host}:${port}/`;
75
75
  if (ctx.options.dev) {
76
76
  const nuxiCLI = await kit.resolvePath("nuxi/cli");
77
- ctx.serverProcess = execa(nuxiCLI, ["_dev"], {
78
- cwd: ctx.nuxt.options.rootDir,
79
- stdio: "inherit",
80
- env: {
81
- ...process.env,
82
- _PORT: String(port),
83
- // Used by internal _dev command
84
- PORT: String(port),
85
- HOST: host,
86
- NODE_ENV: "development",
87
- ...options.env,
88
- ...ctx.options.env
77
+ ctx.serverProcess = exec(nuxiCLI, ["_dev"], {
78
+ nodeOptions: {
79
+ cwd: ctx.nuxt.options.rootDir,
80
+ stdio: "inherit",
81
+ env: {
82
+ ...process.env,
83
+ _PORT: String(port),
84
+ // Used by internal _dev command
85
+ PORT: String(port),
86
+ HOST: host,
87
+ NODE_ENV: "development",
88
+ ...options.env,
89
+ ...ctx.options.env
90
+ }
89
91
  }
90
92
  });
91
93
  await waitForPort(port, { retries: 32, host }).catch(() => {
@@ -94,7 +96,9 @@ async function startServer(options = {}) {
94
96
  for (let i = 0; i < 150; i++) {
95
97
  await new Promise((resolve2) => setTimeout(resolve2, 100));
96
98
  try {
97
- const res = await $fetch(ctx.nuxt.options.app.baseURL, { responseType: "text" });
99
+ const res = await $fetch(ctx.nuxt.options.app.baseURL, {
100
+ responseType: "text"
101
+ });
98
102
  if (!res.includes("__NUXT_LOADING__")) {
99
103
  return;
100
104
  }
@@ -105,19 +109,23 @@ async function startServer(options = {}) {
105
109
  ctx.serverProcess.kill();
106
110
  throw lastError || new Error("Timeout waiting for dev server!");
107
111
  } else {
108
- ctx.serverProcess = execa("node", [
109
- resolve$1(ctx.nuxt.options.nitro.output.dir, "server/index.mjs")
110
- ], {
111
- stdio: "inherit",
112
- env: {
113
- ...process.env,
114
- PORT: String(port),
115
- HOST: host,
116
- NODE_ENV: "test",
117
- ...options.env,
118
- ...ctx.options.env
112
+ ctx.serverProcess = exec(
113
+ "node",
114
+ [resolve$1(ctx.nuxt.options.nitro.output.dir, "server/index.mjs")],
115
+ {
116
+ nodeOptions: {
117
+ stdio: "inherit",
118
+ env: {
119
+ ...process.env,
120
+ PORT: String(port),
121
+ HOST: host,
122
+ NODE_ENV: "test",
123
+ ...options.env,
124
+ ...ctx.options.env
125
+ }
126
+ }
119
127
  }
120
- });
128
+ );
121
129
  await waitForPort(port, { retries: 20, host });
122
130
  }
123
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/test-utils",
3
- "version": "3.14.1",
3
+ "version": "3.14.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/test-utils.git"
@@ -40,14 +40,13 @@
40
40
  "release": "pnpm prepack && pnpm test:examples && changelogen --release --push"
41
41
  },
42
42
  "dependencies": {
43
- "@nuxt/kit": "^3.12.4",
44
- "@nuxt/schema": "^3.12.4",
45
- "c12": "^1.11.1",
43
+ "@nuxt/kit": "^3.13.1",
44
+ "@nuxt/schema": "^3.13.1",
45
+ "c12": "^1.11.2",
46
46
  "consola": "^3.2.3",
47
47
  "defu": "^6.1.4",
48
48
  "destr": "^2.0.3",
49
49
  "estree-walker": "^3.0.3",
50
- "execa": "^8.0.1",
51
50
  "fake-indexeddb": "^6.0.0",
52
51
  "get-port-please": "^3.1.2",
53
52
  "local-pkg": "^0.5.0",
@@ -59,18 +58,19 @@
59
58
  "radix3": "^1.1.2",
60
59
  "scule": "^1.3.0",
61
60
  "std-env": "^3.7.0",
61
+ "tinyexec": "^0.3.0",
62
62
  "ufo": "^1.5.4",
63
63
  "unenv": "^1.10.0",
64
- "unplugin": "^1.12.1",
65
- "vitest-environment-nuxt": "^1.0.0"
64
+ "unplugin": "^1.14.0",
65
+ "vitest-environment-nuxt": "^1.0.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@cucumber/cucumber": "10.8.0",
68
+ "@cucumber/cucumber": "11.0.0",
69
69
  "@jest/globals": "29.7.0",
70
70
  "@nuxt/devtools": "1.0.8",
71
- "@nuxt/eslint-config": "0.5.0",
72
- "@nuxt/module-builder": "0.8.2",
73
- "@playwright/test": "1.46.0",
71
+ "@nuxt/eslint-config": "0.5.6",
72
+ "@nuxt/module-builder": "0.8.3",
73
+ "@playwright/test": "1.47.0",
74
74
  "@testing-library/vue": "8.1.0",
75
75
  "@types/estree": "1.0.5",
76
76
  "@types/jsdom": "21.1.7",
@@ -79,32 +79,32 @@
79
79
  "@vue/test-utils": "2.4.6",
80
80
  "changelogen": "0.5.5",
81
81
  "compatx": "0.1.8",
82
- "eslint": "9.9.0",
82
+ "eslint": "9.10.0",
83
83
  "h3": "1.12.0",
84
84
  "jiti": "1.21.6",
85
85
  "nitropack": "2.9.7",
86
- "nuxt": "3.12.4",
87
- "playwright-core": "1.46.0",
88
- "rollup": "4.20.0",
86
+ "nuxt": "3.13.1",
87
+ "playwright-core": "1.47.0",
88
+ "rollup": "4.21.2",
89
89
  "semver": "7.6.3",
90
- "typescript": "5.5.4",
90
+ "typescript": "5.6.2",
91
91
  "unbuild": "latest",
92
- "unimport": "3.10.0",
93
- "vite": "5.4.0",
92
+ "unimport": "3.11.1",
93
+ "vite": "5.4.3",
94
94
  "vitest": "2.0.5",
95
95
  "vue-router": "4.4.3",
96
- "vue-tsc": "2.0.29"
96
+ "vue-tsc": "2.1.6"
97
97
  },
98
98
  "peerDependencies": {
99
- "@cucumber/cucumber": "^10.3.1",
99
+ "@cucumber/cucumber": "^10.3.1 || ^11.0.0",
100
100
  "@jest/globals": "^29.5.0",
101
101
  "@playwright/test": "^1.43.1",
102
102
  "@testing-library/vue": "^7.0.0 || ^8.0.1",
103
103
  "@vitest/ui": "^0.34.6 || ^1.0.0 || ^2.0.0",
104
104
  "@vue/test-utils": "^2.4.2",
105
105
  "h3": "*",
106
- "happy-dom": "^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
107
- "jsdom": "^22.0.0 || ^23.0.0 || ^24.0.0",
106
+ "happy-dom": "^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
107
+ "jsdom": "^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.0.0",
108
108
  "nitropack": "*",
109
109
  "playwright-core": "^1.43.1",
110
110
  "vite": "*",
@@ -145,19 +145,19 @@
145
145
  }
146
146
  },
147
147
  "resolutions": {
148
- "@cucumber/cucumber": "10.8.0",
148
+ "@cucumber/cucumber": "11.0.0",
149
149
  "@nuxt/devtools": "1.0.8",
150
- "@nuxt/kit": "^3.12.4",
151
- "@nuxt/schema": "^3.12.4",
150
+ "@nuxt/kit": "^3.13.1",
151
+ "@nuxt/schema": "^3.13.1",
152
152
  "@nuxt/test-utils": "workspace:*",
153
- "rollup": "4.20.0",
154
- "vite": "5.4.0",
153
+ "rollup": "4.21.2",
154
+ "vite": "5.4.3",
155
155
  "vite-node": "2.0.5",
156
156
  "vitest": "2.0.5",
157
- "vue": "^3.4.37"
157
+ "vue": "^3.5.4"
158
158
  },
159
159
  "engines": {
160
160
  "node": ">=18.20.4"
161
161
  },
162
- "packageManager": "pnpm@9.7.0"
162
+ "packageManager": "pnpm@9.10.0"
163
163
  }