@nuxt/test-utils 3.13.0 → 3.13.1

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.mjs CHANGED
@@ -46,6 +46,8 @@ async function startNuxtAndGetViteConfig(rootDir = process.cwd(), options = {})
46
46
  }),
47
47
  overrides: defu(
48
48
  {
49
+ appId: "nuxt-app",
50
+ buildId: "test",
49
51
  ssr: false,
50
52
  test: true,
51
53
  modules: ["@nuxt/test-utils/module"]
package/dist/e2e.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.CozWIxfy.mjs';
2
- export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.CozWIxfy.mjs';
1
+ import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.TBc-WRBw.mjs';
2
+ export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.TBc-WRBw.mjs';
3
3
  import { LogType } from 'consola';
4
4
  import * as nitropack from 'nitropack';
5
5
  import 'playwright-core';
package/dist/e2e.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.CozWIxfy.js';
2
- export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.CozWIxfy.js';
1
+ import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.TBc-WRBw.js';
2
+ export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.TBc-WRBw.js';
3
3
  import { LogType } from 'consola';
4
4
  import * as nitropack from 'nitropack';
5
5
  import 'playwright-core';
@@ -1,7 +1,7 @@
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.CozWIxfy.mjs';
4
+ import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.TBc-WRBw.mjs';
5
5
  import '@nuxt/schema';
6
6
  import 'execa';
7
7
 
@@ -1,7 +1,7 @@
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.CozWIxfy.js';
4
+ import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.TBc-WRBw.js';
5
5
  import '@nuxt/schema';
6
6
  import 'execa';
7
7
 
@@ -113,7 +113,7 @@ declare function mountSuspended<T>(component: T, options?: MountSuspendedOptions
113
113
  setupState: SetupState;
114
114
  }>;
115
115
 
116
- type RenderOptions = RenderOptions$1 & {
116
+ type RenderOptions<C = unknown> = RenderOptions$1<C> & {
117
117
  route?: RouteLocationRaw;
118
118
  };
119
119
  /**
@@ -146,7 +146,7 @@ type RenderOptions = RenderOptions$1 & {
146
146
  * @param component the component to be tested
147
147
  * @param options optional options to set up your component
148
148
  */
149
- declare function renderSuspended<T>(component: T, options?: RenderOptions): Promise<_testing_library_vue.RenderResult>;
149
+ declare function renderSuspended<T>(component: T, options?: RenderOptions<T>): Promise<_testing_library_vue.RenderResult>;
150
150
  declare global {
151
151
  interface Window {
152
152
  __cleanup?: Array<() => void>;
@@ -113,7 +113,7 @@ declare function mountSuspended<T>(component: T, options?: MountSuspendedOptions
113
113
  setupState: SetupState;
114
114
  }>;
115
115
 
116
- type RenderOptions = RenderOptions$1 & {
116
+ type RenderOptions<C = unknown> = RenderOptions$1<C> & {
117
117
  route?: RouteLocationRaw;
118
118
  };
119
119
  /**
@@ -146,7 +146,7 @@ type RenderOptions = RenderOptions$1 & {
146
146
  * @param component the component to be tested
147
147
  * @param options optional options to set up your component
148
148
  */
149
- declare function renderSuspended<T>(component: T, options?: RenderOptions): Promise<_testing_library_vue.RenderResult>;
149
+ declare function renderSuspended<T>(component: T, options?: RenderOptions<T>): Promise<_testing_library_vue.RenderResult>;
150
150
  declare global {
151
151
  interface Window {
152
152
  __cleanup?: Array<() => void>;
@@ -73,7 +73,7 @@ async function mountSuspended(component, options) {
73
73
  route = "/",
74
74
  ..._options
75
75
  } = options || {};
76
- const vueApp = tryUseNuxtApp().vueApp;
76
+ const vueApp = tryUseNuxtApp()?.vueApp || globalThis.__unctx__.get("nuxt-app").tryUse().vueApp;
77
77
  const { render, setup } = component;
78
78
  let setupContext;
79
79
  let setupState;
@@ -172,7 +172,7 @@ async function renderSuspended(component, options) {
172
172
  ..._options
173
173
  } = options || {};
174
174
  const { render: renderFromTestingLibrary } = await import('@testing-library/vue');
175
- const vueApp = tryUseNuxtApp().vueApp;
175
+ const vueApp = tryUseNuxtApp()?.vueApp || globalThis.__unctx__.get("nuxt-app").tryUse().vueApp;
176
176
  const { render, setup } = component;
177
177
  for (const fn of window.__cleanup || []) {
178
178
  fn();
@@ -215,7 +215,7 @@ async function renderSuspended(component, options) {
215
215
  render: render ? (_ctx, ...args) => render(renderContext, ...args) : void 0,
216
216
  setup: setup ? (props2) => setup(props2, setupContext) : void 0
217
217
  };
218
- return () => h$1(clonedComponent, { ...props, ...attrs }, slots);
218
+ return () => h$1(clonedComponent, { ...props && typeof props === "object" ? props : {}, ...attrs }, slots);
219
219
  }
220
220
  })
221
221
  }
@@ -1,6 +1,6 @@
1
1
  import { Browser, BrowserContextOptions, Page, Response, LaunchOptions } from 'playwright-core';
2
2
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
3
- import { Subprocess } from 'execa';
3
+ import { ExecaChildProcess } from 'execa';
4
4
 
5
5
  declare function createBrowser(): Promise<void>;
6
6
  declare function getBrowser(): Promise<Browser>;
@@ -41,7 +41,7 @@ interface TestContext {
41
41
  nuxt?: Nuxt;
42
42
  browser?: Browser;
43
43
  url?: string;
44
- serverProcess?: Subprocess;
44
+ serverProcess?: ExecaChildProcess;
45
45
  mockFn?: (...args: unknown[]) => unknown;
46
46
  /**
47
47
  * Functions to run on the vitest `afterAll` hook.
@@ -1,6 +1,6 @@
1
1
  import { Browser, BrowserContextOptions, Page, Response, LaunchOptions } from 'playwright-core';
2
2
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
3
- import { Subprocess } from 'execa';
3
+ import { ExecaChildProcess } from 'execa';
4
4
 
5
5
  declare function createBrowser(): Promise<void>;
6
6
  declare function getBrowser(): Promise<Browser>;
@@ -41,7 +41,7 @@ interface TestContext {
41
41
  nuxt?: Nuxt;
42
42
  browser?: Browser;
43
43
  url?: string;
44
- serverProcess?: Subprocess;
44
+ serverProcess?: ExecaChildProcess;
45
45
  mockFn?: (...args: unknown[]) => unknown;
46
46
  /**
47
47
  * Functions to run on the vitest `afterAll` hook.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/test-utils",
3
- "version": "3.13.0",
3
+ "version": "3.13.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/test-utils.git"
@@ -29,6 +29,16 @@
29
29
  "runtime.d.ts",
30
30
  "vitest-environment.d.ts"
31
31
  ],
32
+ "scripts": {
33
+ "lint": "eslint .",
34
+ "lint:fix": "eslint . --fix",
35
+ "test:examples": "pnpm -r test --filter !example-app-cucumber && pnpm -r test --filter example-app-cucumber",
36
+ "test:types": "vue-tsc --noEmit",
37
+ "test:unit": "vitest test/unit --run",
38
+ "prepack": "unbuild",
39
+ "dev:prepare": "nuxi prepare && unbuild --stub && pnpm -r dev:prepare",
40
+ "release": "pnpm prepack && pnpm test:examples && changelogen --release --push"
41
+ },
32
42
  "dependencies": {
33
43
  "@nuxt/kit": "^3.11.2",
34
44
  "@nuxt/schema": "^3.11.2",
@@ -37,7 +47,7 @@
37
47
  "defu": "^6.1.4",
38
48
  "destr": "^2.0.3",
39
49
  "estree-walker": "^3.0.3",
40
- "execa": "^9.1.0",
50
+ "execa": "^8.0.1",
41
51
  "fake-indexeddb": "^5.0.2",
42
52
  "get-port-please": "^3.1.2",
43
53
  "local-pkg": "^0.5.0",
@@ -58,17 +68,17 @@
58
68
  "@cucumber/cucumber": "10.7.0",
59
69
  "@jest/globals": "29.7.0",
60
70
  "@nuxt/devtools": "1.0.8",
61
- "@nuxt/eslint-config": "0.3.12",
71
+ "@nuxt/eslint-config": "0.3.13",
62
72
  "@nuxt/module-builder": "0.6.0",
63
73
  "@playwright/test": "1.44.0",
64
- "@testing-library/vue": "8.0.3",
74
+ "@testing-library/vue": "8.1.0",
65
75
  "@types/estree": "1.0.5",
66
76
  "@types/jsdom": "21.1.6",
67
77
  "@types/semver": "7.5.8",
68
78
  "@vitest/ui": "1.6.0",
69
79
  "@vue/test-utils": "2.4.6",
70
80
  "changelogen": "0.5.5",
71
- "eslint": "9.2.0",
81
+ "eslint": "9.3.0",
72
82
  "h3": "1.11.1",
73
83
  "jiti": "1.21.0",
74
84
  "nitropack": "2.9.6",
@@ -81,7 +91,7 @@
81
91
  "vite": "5.2.11",
82
92
  "vitest": "1.6.0",
83
93
  "vue-router": "4.3.2",
84
- "vue-tsc": "2.0.17"
94
+ "vue-tsc": "2.0.19"
85
95
  },
86
96
  "peerDependencies": {
87
97
  "@cucumber/cucumber": "^10.3.1",
@@ -142,15 +152,12 @@
142
152
  "vue": "^3.4.27"
143
153
  },
144
154
  "engines": {
145
- "node": ">=18.19.0"
155
+ "node": ">=18.20.2"
146
156
  },
147
- "scripts": {
148
- "lint": "eslint .",
149
- "lint:fix": "eslint . --fix",
150
- "test:examples": "pnpm -r test --filter !example-app-cucumber && pnpm -r test --filter example-app-cucumber",
151
- "test:types": "vue-tsc --noEmit",
152
- "test:unit": "vitest test/unit --run",
153
- "dev:prepare": "nuxi prepare && unbuild --stub && pnpm -r dev:prepare",
154
- "release": "pnpm prepack && pnpm test:examples && changelogen --release --push"
157
+ "packageManager": "pnpm@9.1.1",
158
+ "pnpm": {
159
+ "patchedDependencies": {
160
+ "nuxt@3.11.2": "patches/nuxt@3.11.2.patch"
161
+ }
155
162
  }
156
- }
163
+ }