@nuxt/test-utils 3.12.0 → 3.13.0
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 +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/e2e.d.mts +8 -7
- package/dist/e2e.d.ts +8 -7
- package/dist/e2e.mjs +4 -4
- package/dist/experimental.d.mts +2 -2
- package/dist/experimental.d.ts +2 -2
- package/dist/experimental.mjs +1 -1
- package/dist/module.mjs +4 -4
- package/dist/playwright.d.mts +1 -1
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.mjs +2 -23
- package/dist/runtime/entry.mjs +1 -2
- package/dist/runtime-utils/index.d.mts +8 -2
- package/dist/runtime-utils/index.d.ts +8 -2
- package/dist/runtime-utils/index.mjs +19 -14
- package/dist/shared/{test-utils.B57u8E0c.mjs → test-utils.C7cWLW4C.mjs} +2 -2
- package/dist/shared/{test-utils.9059LSjm.d.mts → test-utils.CozWIxfy.d.mts} +3 -3
- package/dist/shared/{test-utils.9059LSjm.d.ts → test-utils.CozWIxfy.d.ts} +3 -3
- package/dist/shared/{test-utils.BegIhSnH.mjs → test-utils.D8NWZeqn.mjs} +4 -4
- package/dist/vitest-environment.d.mts +13 -8
- package/dist/vitest-environment.d.ts +13 -8
- package/dist/vitest-environment.mjs +20 -28
- package/package.json +48 -50
- package/playwright.d.ts +1 -0
package/dist/config.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ declare function getVitestConfigFromNuxt(options?: GetVitestConfigOptions, loadN
|
|
|
17
17
|
}>;
|
|
18
18
|
declare function defineVitestConfig(config?: InlineConfig & {
|
|
19
19
|
test?: InlineConfig$1;
|
|
20
|
-
}): vite.UserConfig & Promise<vite.UserConfig> & vite.UserConfigFnObject & vite.UserConfigExport;
|
|
20
|
+
}): vite.UserConfig & Promise<vite.UserConfig> & (vite.UserConfigFnObject & vite.UserConfigExport);
|
|
21
21
|
declare module 'vitest' {
|
|
22
22
|
interface EnvironmentOptions {
|
|
23
23
|
nuxt?: {
|
package/dist/config.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare function getVitestConfigFromNuxt(options?: GetVitestConfigOptions, loadN
|
|
|
17
17
|
}>;
|
|
18
18
|
declare function defineVitestConfig(config?: InlineConfig & {
|
|
19
19
|
test?: InlineConfig$1;
|
|
20
|
-
}): vite.UserConfig & Promise<vite.UserConfig> & vite.UserConfigFnObject & vite.UserConfigExport;
|
|
20
|
+
}): vite.UserConfig & Promise<vite.UserConfig> & (vite.UserConfigFnObject & vite.UserConfigExport);
|
|
21
21
|
declare module 'vitest' {
|
|
22
22
|
interface EnvironmentOptions {
|
|
23
23
|
nuxt?: {
|
package/dist/config.mjs
CHANGED
|
@@ -88,7 +88,7 @@ async function getVitestConfigFromNuxt(options, loadNuxtOptions = {}) {
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
options.viteConfig.plugins = (options.viteConfig.plugins || []).filter((p) => !excludedPlugins.includes(p
|
|
91
|
+
options.viteConfig.plugins = (options.viteConfig.plugins || []).filter((p) => !p || !("name" in p) || !excludedPlugins.includes(p.name));
|
|
92
92
|
const resolvedConfig = defu(
|
|
93
93
|
// overrides
|
|
94
94
|
{
|
package/dist/e2e.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.
|
|
2
|
-
export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.
|
|
3
|
-
import {
|
|
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';
|
|
3
|
+
import { LogType } from 'consola';
|
|
4
|
+
import * as nitropack from 'nitropack';
|
|
4
5
|
import 'playwright-core';
|
|
5
6
|
import '@nuxt/schema';
|
|
6
7
|
import 'execa';
|
|
@@ -13,8 +14,8 @@ declare function isDev(): boolean;
|
|
|
13
14
|
declare function recoverContextFromEnv(): void;
|
|
14
15
|
declare function exposeContextToEnv(): void;
|
|
15
16
|
|
|
16
|
-
declare function mockFn():
|
|
17
|
-
declare function mockLogger(): Record<
|
|
17
|
+
declare function mockFn(): ((...args: unknown[]) => unknown) | undefined;
|
|
18
|
+
declare function mockLogger(): Record<LogType, (...args: unknown[]) => void>;
|
|
18
19
|
|
|
19
20
|
declare function loadFixture(): Promise<void>;
|
|
20
21
|
declare function buildFixture(): Promise<void>;
|
|
@@ -24,8 +25,8 @@ interface StartServerOptions {
|
|
|
24
25
|
}
|
|
25
26
|
declare function startServer(options?: StartServerOptions): Promise<void>;
|
|
26
27
|
declare function stopServer(): Promise<void>;
|
|
27
|
-
declare function fetch(path: string, options?:
|
|
28
|
-
declare
|
|
28
|
+
declare function fetch(path: string, options?: RequestInit): Promise<Response>;
|
|
29
|
+
declare const $fetch: nitropack.$Fetch<unknown, nitropack.NitroFetchRequest>;
|
|
29
30
|
declare function url(path: string): string;
|
|
30
31
|
|
|
31
32
|
declare function setupCucumber(hooks: TestHooks): Promise<void>;
|
package/dist/e2e.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { T as TestOptions, a as TestContext, b as TestHooks } from './shared/test-utils.
|
|
2
|
-
export { G as GotoOptions, e as TestRunner, c as createBrowser, d as createPage, g as getBrowser, w as waitForHydration } from './shared/test-utils.
|
|
3
|
-
import {
|
|
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';
|
|
3
|
+
import { LogType } from 'consola';
|
|
4
|
+
import * as nitropack from 'nitropack';
|
|
4
5
|
import 'playwright-core';
|
|
5
6
|
import '@nuxt/schema';
|
|
6
7
|
import 'execa';
|
|
@@ -13,8 +14,8 @@ declare function isDev(): boolean;
|
|
|
13
14
|
declare function recoverContextFromEnv(): void;
|
|
14
15
|
declare function exposeContextToEnv(): void;
|
|
15
16
|
|
|
16
|
-
declare function mockFn():
|
|
17
|
-
declare function mockLogger(): Record<
|
|
17
|
+
declare function mockFn(): ((...args: unknown[]) => unknown) | undefined;
|
|
18
|
+
declare function mockLogger(): Record<LogType, (...args: unknown[]) => void>;
|
|
18
19
|
|
|
19
20
|
declare function loadFixture(): Promise<void>;
|
|
20
21
|
declare function buildFixture(): Promise<void>;
|
|
@@ -24,8 +25,8 @@ interface StartServerOptions {
|
|
|
24
25
|
}
|
|
25
26
|
declare function startServer(options?: StartServerOptions): Promise<void>;
|
|
26
27
|
declare function stopServer(): Promise<void>;
|
|
27
|
-
declare function fetch(path: string, options?:
|
|
28
|
-
declare
|
|
28
|
+
declare function fetch(path: string, options?: RequestInit): Promise<Response>;
|
|
29
|
+
declare const $fetch: nitropack.$Fetch<unknown, nitropack.NitroFetchRequest>;
|
|
29
30
|
declare function url(path: string): string;
|
|
30
31
|
|
|
31
32
|
declare function setupCucumber(hooks: TestHooks): Promise<void>;
|
package/dist/e2e.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as distDir } from './shared/test-utils.
|
|
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.
|
|
3
|
-
import { u as useTestContext } from './shared/test-utils.
|
|
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.
|
|
1
|
+
import { d as distDir } from './shared/test-utils.C7cWLW4C.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.C7cWLW4C.mjs';
|
|
3
|
+
import { u as useTestContext } from './shared/test-utils.D8NWZeqn.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.D8NWZeqn.mjs';
|
|
5
5
|
import { consola } from 'consola';
|
|
6
6
|
import { resolve } from 'pathe';
|
|
7
7
|
import 'node:fs';
|
package/dist/experimental.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is a function to render a component directly with the Nuxt server.
|
|
3
3
|
*/
|
|
4
|
-
declare function $fetchComponent(filepath: string, props?: Record<string,
|
|
5
|
-
declare function componentTestUrl(filepath: string, props?: Record<string,
|
|
4
|
+
declare function $fetchComponent(filepath: string, props?: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
declare function componentTestUrl(filepath: string, props?: Record<string, unknown>): string;
|
|
6
6
|
|
|
7
7
|
export { $fetchComponent, componentTestUrl };
|
package/dist/experimental.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is a function to render a component directly with the Nuxt server.
|
|
3
3
|
*/
|
|
4
|
-
declare function $fetchComponent(filepath: string, props?: Record<string,
|
|
5
|
-
declare function componentTestUrl(filepath: string, props?: Record<string,
|
|
4
|
+
declare function $fetchComponent(filepath: string, props?: Record<string, unknown>): Promise<unknown>;
|
|
5
|
+
declare function componentTestUrl(filepath: string, props?: Record<string, unknown>): string;
|
|
6
6
|
|
|
7
7
|
export { $fetchComponent, componentTestUrl };
|
package/dist/experimental.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve } from 'pathe';
|
|
2
2
|
import { stringifyQuery } from 'ufo';
|
|
3
|
-
import { $ as $fetch, u as useTestContext } from './shared/test-utils.
|
|
3
|
+
import { $ as $fetch, u as useTestContext } from './shared/test-utils.D8NWZeqn.mjs';
|
|
4
4
|
import 'execa';
|
|
5
5
|
import 'get-port-please';
|
|
6
6
|
import 'ofetch';
|
package/dist/module.mjs
CHANGED
|
@@ -218,7 +218,7 @@ const createMockPlugin = (ctx) => createUnplugin(() => {
|
|
|
218
218
|
// Place Vitest's mock plugin after all Nuxt plugins
|
|
219
219
|
async configResolved(config) {
|
|
220
220
|
const plugins = config.plugins || [];
|
|
221
|
-
const vitestPlugins = plugins.filter((p) => (p.name === "vite:mocks" || p.name.startsWith("vitest:")) && (p.enforce || p.order) === "post");
|
|
221
|
+
const vitestPlugins = plugins.filter((p) => (p.name === "vite:mocks" || p.name.startsWith("vitest:")) && (p.enforce || "order" in p && p.order) === "post");
|
|
222
222
|
const lastNuxt = findLastIndex(
|
|
223
223
|
plugins,
|
|
224
224
|
(i) => i.name?.startsWith("nuxt:")
|
|
@@ -262,10 +262,10 @@ function isExpressionStatement(node) {
|
|
|
262
262
|
return node?.type === "ExpressionStatement";
|
|
263
263
|
}
|
|
264
264
|
function startOf(node) {
|
|
265
|
-
return "range" in node && node.range ? node.range[0] : node.start;
|
|
265
|
+
return "range" in node && node.range ? node.range[0] : "start" in node ? node.start : void 0;
|
|
266
266
|
}
|
|
267
267
|
function endOf(node) {
|
|
268
|
-
return "range" in node && node.range ? node.range[1] : node.end;
|
|
268
|
+
return "range" in node && node.range ? node.range[1] : "end" in node ? node.end : void 0;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
function setupImportMocking() {
|
|
@@ -367,7 +367,7 @@ const module = defineNuxtModule({
|
|
|
367
367
|
const rawViteConfig = mergeConfig({}, await rawViteConfigPromise);
|
|
368
368
|
const viteConfig = await getVitestConfigFromNuxt({ nuxt, viteConfig: defu({ test: options.vitestConfig }, rawViteConfig) });
|
|
369
369
|
viteConfig.plugins = (viteConfig.plugins || []).filter((p) => {
|
|
370
|
-
return !vitePluginBlocklist.includes(p
|
|
370
|
+
return !p || !("name" in p) || !vitePluginBlocklist.includes(p.name);
|
|
371
371
|
});
|
|
372
372
|
process.env.__NUXT_VITEST_RESOLVED__ = "true";
|
|
373
373
|
const { startVitest } = await import(pathToFileURL(await resolvePath("vitest/node")).href);
|
package/dist/playwright.d.mts
CHANGED
|
@@ -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.
|
|
4
|
+
import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.CozWIxfy.mjs';
|
|
5
5
|
import '@nuxt/schema';
|
|
6
6
|
import 'execa';
|
|
7
7
|
|
package/dist/playwright.d.ts
CHANGED
|
@@ -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.
|
|
4
|
+
import { T as TestOptions$1, b as TestHooks, G as GotoOptions } from './shared/test-utils.CozWIxfy.js';
|
|
5
5
|
import '@nuxt/schema';
|
|
6
6
|
import 'execa';
|
|
7
7
|
|
package/dist/playwright.mjs
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
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.
|
|
3
|
+
import { e as createTest, w as waitForHydration } from './shared/test-utils.C7cWLW4C.mjs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import 'consola';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import '@nuxt/kit';
|
|
9
|
-
import { d as url } from './shared/test-utils.
|
|
9
|
+
import { d as url } from './shared/test-utils.D8NWZeqn.mjs';
|
|
10
10
|
import 'pathe';
|
|
11
11
|
import 'node:url';
|
|
12
12
|
import 'execa';
|
|
13
13
|
import 'get-port-please';
|
|
14
14
|
import 'ofetch';
|
|
15
15
|
|
|
16
|
-
{
|
|
17
|
-
if (process.env.TEST_WORKER_INDEX) {
|
|
18
|
-
for (const stream of [process.stdout, process.stderr]) {
|
|
19
|
-
if (!stream.clearLine) {
|
|
20
|
-
stream.clearLine = (dir, callback) => {
|
|
21
|
-
callback?.();
|
|
22
|
-
return true;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if (!stream.cursorTo) {
|
|
26
|
-
stream.cursorTo = (x, y, callback) => {
|
|
27
|
-
if (callback)
|
|
28
|
-
callback();
|
|
29
|
-
else if (y instanceof Function)
|
|
30
|
-
y();
|
|
31
|
-
return true;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
16
|
const test = test$1.extend({
|
|
38
17
|
nuxt: [void 0, { option: true, scope: "worker" }],
|
|
39
18
|
_nuxtHooks: [
|
package/dist/runtime/entry.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { vi } from "vitest";
|
|
2
|
-
if (typeof window !== "undefined" &&
|
|
3
|
-
window.__NUXT_VITEST_ENVIRONMENT__) {
|
|
2
|
+
if (typeof window !== "undefined" && window.__NUXT_VITEST_ENVIRONMENT__) {
|
|
4
3
|
const { useRouter } = await import("#app/composables/router");
|
|
5
4
|
await import("#app/nuxt-vitest-app-entry").then((r) => r.default());
|
|
6
5
|
const nuxtApp = useNuxtApp();
|
|
@@ -41,7 +41,7 @@ declare function registerEndpoint(url: string, options: EventHandler | {
|
|
|
41
41
|
* ```
|
|
42
42
|
* @see https://nuxt.com/docs/getting-started/testing#mocknuxtimport
|
|
43
43
|
*/
|
|
44
|
-
declare function mockNuxtImport<T =
|
|
44
|
+
declare function mockNuxtImport<T = unknown>(_name: string, _factory: () => T | Promise<T>): void;
|
|
45
45
|
/**
|
|
46
46
|
* `mockComponent` allows you to mock Nuxt's component.
|
|
47
47
|
* @param path - component name in PascalCase, or the relative path of the component.
|
|
@@ -82,6 +82,7 @@ declare function mockComponent<PropsOptions extends Readonly<ComponentPropsOptio
|
|
|
82
82
|
type MountSuspendedOptions<T> = ComponentMountingOptions<T> & {
|
|
83
83
|
route?: RouteLocationRaw;
|
|
84
84
|
};
|
|
85
|
+
type SetupState = Record<string, any>;
|
|
85
86
|
/**
|
|
86
87
|
* `mountSuspended` allows you to mount any vue component within the Nuxt environment, allowing async setup and access to injections from your Nuxt plugins. For example:
|
|
87
88
|
*
|
|
@@ -109,7 +110,7 @@ type MountSuspendedOptions<T> = ComponentMountingOptions<T> & {
|
|
|
109
110
|
* @param options optional options to set up your component
|
|
110
111
|
*/
|
|
111
112
|
declare function mountSuspended<T>(component: T, options?: MountSuspendedOptions<T>): Promise<ReturnType<typeof mount<T>> & {
|
|
112
|
-
setupState:
|
|
113
|
+
setupState: SetupState;
|
|
113
114
|
}>;
|
|
114
115
|
|
|
115
116
|
type RenderOptions = RenderOptions$1 & {
|
|
@@ -146,5 +147,10 @@ type RenderOptions = RenderOptions$1 & {
|
|
|
146
147
|
* @param options optional options to set up your component
|
|
147
148
|
*/
|
|
148
149
|
declare function renderSuspended<T>(component: T, options?: RenderOptions): Promise<_testing_library_vue.RenderResult>;
|
|
150
|
+
declare global {
|
|
151
|
+
interface Window {
|
|
152
|
+
__cleanup?: Array<() => void>;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
149
155
|
|
|
150
156
|
export { mockComponent, mockNuxtImport, mountSuspended, registerEndpoint, renderSuspended };
|
|
@@ -41,7 +41,7 @@ declare function registerEndpoint(url: string, options: EventHandler | {
|
|
|
41
41
|
* ```
|
|
42
42
|
* @see https://nuxt.com/docs/getting-started/testing#mocknuxtimport
|
|
43
43
|
*/
|
|
44
|
-
declare function mockNuxtImport<T =
|
|
44
|
+
declare function mockNuxtImport<T = unknown>(_name: string, _factory: () => T | Promise<T>): void;
|
|
45
45
|
/**
|
|
46
46
|
* `mockComponent` allows you to mock Nuxt's component.
|
|
47
47
|
* @param path - component name in PascalCase, or the relative path of the component.
|
|
@@ -82,6 +82,7 @@ declare function mockComponent<PropsOptions extends Readonly<ComponentPropsOptio
|
|
|
82
82
|
type MountSuspendedOptions<T> = ComponentMountingOptions<T> & {
|
|
83
83
|
route?: RouteLocationRaw;
|
|
84
84
|
};
|
|
85
|
+
type SetupState = Record<string, any>;
|
|
85
86
|
/**
|
|
86
87
|
* `mountSuspended` allows you to mount any vue component within the Nuxt environment, allowing async setup and access to injections from your Nuxt plugins. For example:
|
|
87
88
|
*
|
|
@@ -109,7 +110,7 @@ type MountSuspendedOptions<T> = ComponentMountingOptions<T> & {
|
|
|
109
110
|
* @param options optional options to set up your component
|
|
110
111
|
*/
|
|
111
112
|
declare function mountSuspended<T>(component: T, options?: MountSuspendedOptions<T>): Promise<ReturnType<typeof mount<T>> & {
|
|
112
|
-
setupState:
|
|
113
|
+
setupState: SetupState;
|
|
113
114
|
}>;
|
|
114
115
|
|
|
115
116
|
type RenderOptions = RenderOptions$1 & {
|
|
@@ -146,5 +147,10 @@ type RenderOptions = RenderOptions$1 & {
|
|
|
146
147
|
* @param options optional options to set up your component
|
|
147
148
|
*/
|
|
148
149
|
declare function renderSuspended<T>(component: T, options?: RenderOptions): Promise<_testing_library_vue.RenderResult>;
|
|
150
|
+
declare global {
|
|
151
|
+
interface Window {
|
|
152
|
+
__cleanup?: Array<() => void>;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
149
155
|
|
|
150
156
|
export { mockComponent, mockNuxtImport, mountSuspended, registerEndpoint, renderSuspended };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineEventHandler } from 'h3';
|
|
2
2
|
import { mount } from '@vue/test-utils';
|
|
3
|
-
import { reactive, h as h$1, Suspense, nextTick, isReadonly, unref } from 'vue';
|
|
3
|
+
import { reactive, h as h$1, Suspense, nextTick, isReadonly, unref, effectScope } from 'vue';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
|
-
import { defineComponent, useRouter, h } from '#imports';
|
|
5
|
+
import { defineComponent, useRouter, h, tryUseNuxtApp } from '#imports';
|
|
6
6
|
import NuxtRoot from '#build/root-component.mjs';
|
|
7
7
|
|
|
8
8
|
function registerEndpoint(url, options) {
|
|
@@ -73,7 +73,7 @@ async function mountSuspended(component, options) {
|
|
|
73
73
|
route = "/",
|
|
74
74
|
..._options
|
|
75
75
|
} = options || {};
|
|
76
|
-
const vueApp =
|
|
76
|
+
const vueApp = tryUseNuxtApp().vueApp;
|
|
77
77
|
const { render, setup } = component;
|
|
78
78
|
let setupContext;
|
|
79
79
|
let setupState;
|
|
@@ -82,8 +82,9 @@ async function mountSuspended(component, options) {
|
|
|
82
82
|
const wrappedSetup = async (props2, setupContext2) => {
|
|
83
83
|
passedProps = props2;
|
|
84
84
|
if (setup) {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const result = await setup(props2, setupContext2);
|
|
86
|
+
setupState = result && typeof result === "object" ? result : {};
|
|
87
|
+
return result;
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
90
|
return new Promise(
|
|
@@ -150,7 +151,7 @@ async function mountSuspended(component, options) {
|
|
|
150
151
|
stubs: {
|
|
151
152
|
Suspense: false,
|
|
152
153
|
MountSuspendedHelper: false,
|
|
153
|
-
[typeof component.name === "string" ? component.name : "MountSuspendedComponent"]: false
|
|
154
|
+
[component && typeof component === "object" && "name" in component && typeof component.name === "string" ? component.name : "MountSuspendedComponent"]: false
|
|
154
155
|
},
|
|
155
156
|
components: { RouterLink }
|
|
156
157
|
}
|
|
@@ -171,21 +172,28 @@ async function renderSuspended(component, options) {
|
|
|
171
172
|
..._options
|
|
172
173
|
} = options || {};
|
|
173
174
|
const { render: renderFromTestingLibrary } = await import('@testing-library/vue');
|
|
174
|
-
const
|
|
175
|
+
const vueApp = tryUseNuxtApp().vueApp;
|
|
175
176
|
const { render, setup } = component;
|
|
177
|
+
for (const fn of window.__cleanup || []) {
|
|
178
|
+
fn();
|
|
179
|
+
}
|
|
176
180
|
document.querySelector(`#${WRAPPER_EL_ID}`)?.remove();
|
|
177
181
|
let setupContext;
|
|
178
182
|
return new Promise((resolve) => {
|
|
179
183
|
const utils = renderFromTestingLibrary(
|
|
180
184
|
{
|
|
181
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
182
185
|
setup: (props2, ctx) => {
|
|
183
186
|
setupContext = ctx;
|
|
184
|
-
|
|
187
|
+
const scope = effectScope();
|
|
188
|
+
window.__cleanup || (window.__cleanup = []);
|
|
189
|
+
window.__cleanup.push(() => {
|
|
190
|
+
scope.stop();
|
|
191
|
+
});
|
|
192
|
+
return scope.run(() => NuxtRoot.setup(props2, {
|
|
185
193
|
...ctx,
|
|
186
194
|
expose: () => {
|
|
187
195
|
}
|
|
188
|
-
});
|
|
196
|
+
}));
|
|
189
197
|
},
|
|
190
198
|
render: (renderContext) => (
|
|
191
199
|
// See discussions in https://github.com/testing-library/vue-testing-library/issues/230
|
|
@@ -205,10 +213,7 @@ async function renderSuspended(component, options) {
|
|
|
205
213
|
const clonedComponent = {
|
|
206
214
|
...component,
|
|
207
215
|
render: render ? (_ctx, ...args) => render(renderContext, ...args) : void 0,
|
|
208
|
-
setup: setup ? (
|
|
209
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
210
|
-
(props2) => setup(props2, setupContext)
|
|
211
|
-
) : void 0
|
|
216
|
+
setup: setup ? (props2) => setup(props2, setupContext) : void 0
|
|
212
217
|
};
|
|
213
218
|
return () => h$1(clonedComponent, { ...props, ...attrs }, slots);
|
|
214
219
|
}
|
|
@@ -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.
|
|
1
|
+
import { u as useTestContext, d as url, c as createTestContext, s as setTestContext, b as stopServer, a as startServer } from './test-utils.D8NWZeqn.mjs';
|
|
2
2
|
import { existsSync, promises } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { defu } from 'defu';
|
|
@@ -164,7 +164,7 @@ function createTest(options) {
|
|
|
164
164
|
if (ctx.browser) {
|
|
165
165
|
await ctx.browser.close();
|
|
166
166
|
}
|
|
167
|
-
await Promise.all(
|
|
167
|
+
await Promise.all(!ctx.teardown ? [] : ctx.teardown.map((fn) => fn()));
|
|
168
168
|
};
|
|
169
169
|
const setup2 = async () => {
|
|
170
170
|
if (ctx.options.fixture) {
|
|
@@ -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 {
|
|
3
|
+
import { Subprocess } from 'execa';
|
|
4
4
|
|
|
5
5
|
declare function createBrowser(): Promise<void>;
|
|
6
6
|
declare function getBrowser(): Promise<Browser>;
|
|
@@ -41,8 +41,8 @@ interface TestContext {
|
|
|
41
41
|
nuxt?: Nuxt;
|
|
42
42
|
browser?: Browser;
|
|
43
43
|
url?: string;
|
|
44
|
-
serverProcess?:
|
|
45
|
-
mockFn?:
|
|
44
|
+
serverProcess?: Subprocess;
|
|
45
|
+
mockFn?: (...args: unknown[]) => unknown;
|
|
46
46
|
/**
|
|
47
47
|
* Functions to run on the vitest `afterAll` hook.
|
|
48
48
|
* Useful for removing anything created during the test.
|
|
@@ -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 {
|
|
3
|
+
import { Subprocess } from 'execa';
|
|
4
4
|
|
|
5
5
|
declare function createBrowser(): Promise<void>;
|
|
6
6
|
declare function getBrowser(): Promise<Browser>;
|
|
@@ -41,8 +41,8 @@ interface TestContext {
|
|
|
41
41
|
nuxt?: Nuxt;
|
|
42
42
|
browser?: Browser;
|
|
43
43
|
url?: string;
|
|
44
|
-
serverProcess?:
|
|
45
|
-
mockFn?:
|
|
44
|
+
serverProcess?: Subprocess;
|
|
45
|
+
mockFn?: (...args: unknown[]) => unknown;
|
|
46
46
|
/**
|
|
47
47
|
* Functions to run on the vitest `afterAll` hook.
|
|
48
48
|
* Useful for removing anything created during the test.
|
|
@@ -84,7 +84,7 @@ async function startServer(options = {}) {
|
|
|
84
84
|
for (let i = 0; i < 150; i++) {
|
|
85
85
|
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
86
86
|
try {
|
|
87
|
-
const res = await $fetch(ctx.nuxt.options.app.baseURL);
|
|
87
|
+
const res = await $fetch(ctx.nuxt.options.app.baseURL, { responseType: "text" });
|
|
88
88
|
if (!res.includes("__NUXT_LOADING__")) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
@@ -113,15 +113,15 @@ async function startServer(options = {}) {
|
|
|
113
113
|
async function stopServer() {
|
|
114
114
|
const ctx = useTestContext();
|
|
115
115
|
if (ctx.serverProcess) {
|
|
116
|
-
|
|
116
|
+
ctx.serverProcess.kill();
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function fetch(path, options) {
|
|
120
120
|
return fetch$1(url(path), options);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
const $fetch = function(path, options) {
|
|
123
123
|
return $fetch$1(url(path), options);
|
|
124
|
-
}
|
|
124
|
+
};
|
|
125
125
|
function url(path) {
|
|
126
126
|
const ctx = useTestContext();
|
|
127
127
|
if (!ctx.url) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Environment } from 'vitest';
|
|
1
|
+
import { Environment, JSDOMOptions, HappyDOMOptions } from 'vitest';
|
|
2
2
|
import { App } from 'h3';
|
|
3
|
+
import { $Fetch } from 'nitropack';
|
|
3
4
|
|
|
4
5
|
declare const _default: Environment;
|
|
5
6
|
|
|
@@ -8,15 +9,19 @@ interface NuxtWindow extends Window {
|
|
|
8
9
|
__app: App;
|
|
9
10
|
__registry: Set<string>;
|
|
10
11
|
__NUXT_VITEST_ENVIRONMENT__?: boolean;
|
|
11
|
-
__NUXT__:
|
|
12
|
-
$fetch:
|
|
13
|
-
fetch:
|
|
14
|
-
IntersectionObserver:
|
|
15
|
-
Headers:
|
|
12
|
+
__NUXT__: Record<string, unknown>;
|
|
13
|
+
$fetch: $Fetch;
|
|
14
|
+
fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>);
|
|
15
|
+
IntersectionObserver: unknown;
|
|
16
|
+
Headers: typeof Headers;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
interface EnvironmentNuxtOptions {
|
|
19
|
+
jsdom?: JSDOMOptions;
|
|
20
|
+
happyDom?: HappyDOMOptions;
|
|
21
|
+
}
|
|
22
|
+
type EnvironmentNuxt = (global: typeof globalThis, options: EnvironmentNuxtOptions) => Promise<{
|
|
18
23
|
window: NuxtWindow;
|
|
19
24
|
teardown(): void;
|
|
20
25
|
}>;
|
|
21
26
|
|
|
22
|
-
export { type EnvironmentNuxt, type NuxtBuiltinEnvironment, type NuxtWindow, _default as default };
|
|
27
|
+
export { type EnvironmentNuxt, type EnvironmentNuxtOptions, type NuxtBuiltinEnvironment, type NuxtWindow, _default as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Environment } from 'vitest';
|
|
1
|
+
import { Environment, JSDOMOptions, HappyDOMOptions } from 'vitest';
|
|
2
2
|
import { App } from 'h3';
|
|
3
|
+
import { $Fetch } from 'nitropack';
|
|
3
4
|
|
|
4
5
|
declare const _default: Environment;
|
|
5
6
|
|
|
@@ -8,15 +9,19 @@ interface NuxtWindow extends Window {
|
|
|
8
9
|
__app: App;
|
|
9
10
|
__registry: Set<string>;
|
|
10
11
|
__NUXT_VITEST_ENVIRONMENT__?: boolean;
|
|
11
|
-
__NUXT__:
|
|
12
|
-
$fetch:
|
|
13
|
-
fetch:
|
|
14
|
-
IntersectionObserver:
|
|
15
|
-
Headers:
|
|
12
|
+
__NUXT__: Record<string, unknown>;
|
|
13
|
+
$fetch: $Fetch;
|
|
14
|
+
fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>);
|
|
15
|
+
IntersectionObserver: unknown;
|
|
16
|
+
Headers: typeof Headers;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
interface EnvironmentNuxtOptions {
|
|
19
|
+
jsdom?: JSDOMOptions;
|
|
20
|
+
happyDom?: HappyDOMOptions;
|
|
21
|
+
}
|
|
22
|
+
type EnvironmentNuxt = (global: typeof globalThis, options: EnvironmentNuxtOptions) => Promise<{
|
|
18
23
|
window: NuxtWindow;
|
|
19
24
|
teardown(): void;
|
|
20
25
|
}>;
|
|
21
26
|
|
|
22
|
-
export { type EnvironmentNuxt, type NuxtBuiltinEnvironment, type NuxtWindow, _default as default };
|
|
27
|
+
export { type EnvironmentNuxt, type EnvironmentNuxtOptions, type NuxtBuiltinEnvironment, type NuxtWindow, _default as default };
|
|
@@ -9,9 +9,7 @@ import { createCall, createFetch } from 'unenv/runtime/fetch/index';
|
|
|
9
9
|
import { importModule } from 'local-pkg';
|
|
10
10
|
|
|
11
11
|
const happyDom = (async function(_, { happyDom = {} }) {
|
|
12
|
-
const { Window, GlobalWindow } = await importModule(
|
|
13
|
-
"happy-dom"
|
|
14
|
-
);
|
|
12
|
+
const { Window, GlobalWindow } = await importModule("happy-dom");
|
|
15
13
|
const window = new (GlobalWindow || Window)(happyDom);
|
|
16
14
|
return {
|
|
17
15
|
window,
|
|
@@ -23,30 +21,21 @@ const happyDom = (async function(_, { happyDom = {} }) {
|
|
|
23
21
|
|
|
24
22
|
const jsdom = (async function(global, { jsdom = {} }) {
|
|
25
23
|
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await importModule("jsdom");
|
|
26
|
-
const {
|
|
27
|
-
html
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
...
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
|
|
42
|
-
runScripts,
|
|
43
|
-
url,
|
|
44
|
-
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
|
|
45
|
-
cookieJar: cookieJar ? new CookieJar() : void 0,
|
|
46
|
-
includeNodeLocations,
|
|
47
|
-
contentType,
|
|
48
|
-
userAgent,
|
|
49
|
-
...restOptions
|
|
24
|
+
const jsdomOptions = defu(jsdom, {
|
|
25
|
+
html: "<!DOCTYPE html>",
|
|
26
|
+
url: "http://localhost:3000",
|
|
27
|
+
contentType: "text/html",
|
|
28
|
+
pretendToBeVisual: true,
|
|
29
|
+
includeNodeLocations: false,
|
|
30
|
+
runScripts: "dangerously",
|
|
31
|
+
console: false,
|
|
32
|
+
cookieJar: false
|
|
33
|
+
});
|
|
34
|
+
const window = new JSDOM(jsdomOptions.html, {
|
|
35
|
+
...jsdomOptions,
|
|
36
|
+
resources: jsdomOptions.resources ?? (jsdomOptions.userAgent ? new ResourceLoader({ userAgent: jsdomOptions.userAgent }) : void 0),
|
|
37
|
+
virtualConsole: jsdomOptions.console && global.console ? new VirtualConsole().sendTo(global.console) : void 0,
|
|
38
|
+
cookieJar: jsdomOptions.cookieJar ? new CookieJar() : void 0
|
|
50
39
|
}).window;
|
|
51
40
|
window.scrollTo = () => {
|
|
52
41
|
};
|
|
@@ -114,7 +103,10 @@ const index = {
|
|
|
114
103
|
init = "/_" + init;
|
|
115
104
|
}
|
|
116
105
|
}
|
|
117
|
-
return localFetch(init,
|
|
106
|
+
return localFetch(init.toString(), {
|
|
107
|
+
...options,
|
|
108
|
+
headers: Array.isArray(options?.headers) ? new Headers(options?.headers) : options?.headers
|
|
109
|
+
});
|
|
118
110
|
};
|
|
119
111
|
win.$fetch = createFetch$1({ fetch: win.fetch, Headers: win.Headers });
|
|
120
112
|
win.__registry = registry;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/test-utils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/test-utils.git"
|
|
@@ -25,87 +25,76 @@
|
|
|
25
25
|
"e2e.d.ts",
|
|
26
26
|
"experimental.d.ts",
|
|
27
27
|
"module.d.ts",
|
|
28
|
+
"playwright.d.ts",
|
|
28
29
|
"runtime.d.ts",
|
|
29
30
|
"vitest-environment.d.ts"
|
|
30
31
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"lint": "eslint --ext .vue,.ts,.js,.mjs .",
|
|
33
|
-
"lint:fix": "eslint --ext .vue,.ts,.js,.mjs . --fix",
|
|
34
|
-
"test:examples": "pnpm -r test --filter !nuxt-app-cucumber && pnpm -r test --filter nuxt-app-cucumber",
|
|
35
|
-
"test:types": "vue-tsc --noEmit",
|
|
36
|
-
"test:unit": "vitest test/unit --run",
|
|
37
|
-
"prepack": "unbuild",
|
|
38
|
-
"dev:prepare": "nuxi prepare && unbuild --stub && pnpm -r dev:prepare",
|
|
39
|
-
"release": "pnpm prepack && pnpm test:examples && changelogen --release --push"
|
|
40
|
-
},
|
|
41
32
|
"dependencies": {
|
|
42
|
-
"@nuxt/kit": "^3.
|
|
43
|
-
"@nuxt/schema": "^3.
|
|
33
|
+
"@nuxt/kit": "^3.11.2",
|
|
34
|
+
"@nuxt/schema": "^3.11.2",
|
|
44
35
|
"c12": "^1.10.0",
|
|
45
36
|
"consola": "^3.2.3",
|
|
46
37
|
"defu": "^6.1.4",
|
|
47
38
|
"destr": "^2.0.3",
|
|
48
39
|
"estree-walker": "^3.0.3",
|
|
49
|
-
"execa": "^
|
|
40
|
+
"execa": "^9.1.0",
|
|
50
41
|
"fake-indexeddb": "^5.0.2",
|
|
51
42
|
"get-port-please": "^3.1.2",
|
|
52
43
|
"local-pkg": "^0.5.0",
|
|
53
|
-
"magic-string": "^0.30.
|
|
54
|
-
"node-fetch-native": "^1.6.
|
|
55
|
-
"ofetch": "^1.3.
|
|
44
|
+
"magic-string": "^0.30.10",
|
|
45
|
+
"node-fetch-native": "^1.6.4",
|
|
46
|
+
"ofetch": "^1.3.4",
|
|
56
47
|
"pathe": "^1.1.2",
|
|
57
48
|
"perfect-debounce": "^1.0.0",
|
|
58
|
-
"radix3": "^1.1.
|
|
49
|
+
"radix3": "^1.1.2",
|
|
59
50
|
"scule": "^1.3.0",
|
|
60
51
|
"std-env": "^3.7.0",
|
|
61
|
-
"ufo": "^1.5.
|
|
52
|
+
"ufo": "^1.5.3",
|
|
62
53
|
"unenv": "^1.9.0",
|
|
63
|
-
"unplugin": "^1.10.
|
|
54
|
+
"unplugin": "^1.10.1",
|
|
64
55
|
"vitest-environment-nuxt": "^1.0.0"
|
|
65
56
|
},
|
|
66
57
|
"devDependencies": {
|
|
67
|
-
"@cucumber/cucumber": "10.
|
|
58
|
+
"@cucumber/cucumber": "10.7.0",
|
|
68
59
|
"@jest/globals": "29.7.0",
|
|
69
60
|
"@nuxt/devtools": "1.0.8",
|
|
70
|
-
"@nuxt/eslint-config": "0.
|
|
71
|
-
"@nuxt/module-builder": "0.
|
|
72
|
-
"@playwright/test": "1.
|
|
73
|
-
"@testing-library/vue": "8.0.
|
|
61
|
+
"@nuxt/eslint-config": "0.3.12",
|
|
62
|
+
"@nuxt/module-builder": "0.6.0",
|
|
63
|
+
"@playwright/test": "1.44.0",
|
|
64
|
+
"@testing-library/vue": "8.0.3",
|
|
74
65
|
"@types/estree": "1.0.5",
|
|
75
66
|
"@types/jsdom": "21.1.6",
|
|
76
67
|
"@types/semver": "7.5.8",
|
|
77
|
-
"@vitest/ui": "1.
|
|
78
|
-
"@vue/test-utils": "2.4.
|
|
68
|
+
"@vitest/ui": "1.6.0",
|
|
69
|
+
"@vue/test-utils": "2.4.6",
|
|
79
70
|
"changelogen": "0.5.5",
|
|
80
|
-
"eslint": "
|
|
81
|
-
"eslint-plugin-import": "2.29.1",
|
|
82
|
-
"eslint-plugin-jsdoc": "48.2.1",
|
|
83
|
-
"eslint-plugin-no-only-tests": "3.1.0",
|
|
84
|
-
"eslint-plugin-unicorn": "51.0.1",
|
|
71
|
+
"eslint": "9.2.0",
|
|
85
72
|
"h3": "1.11.1",
|
|
86
73
|
"jiti": "1.21.0",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
74
|
+
"nitropack": "2.9.6",
|
|
75
|
+
"nuxt": "3.11.2",
|
|
76
|
+
"playwright-core": "1.44.0",
|
|
77
|
+
"rollup": "4.17.2",
|
|
78
|
+
"semver": "7.6.2",
|
|
91
79
|
"unbuild": "latest",
|
|
92
80
|
"unimport": "3.7.1",
|
|
93
|
-
"vite": "5.
|
|
94
|
-
"vitest": "1.
|
|
95
|
-
"vue-router": "4.3.
|
|
96
|
-
"vue-tsc": "2.0.
|
|
81
|
+
"vite": "5.2.11",
|
|
82
|
+
"vitest": "1.6.0",
|
|
83
|
+
"vue-router": "4.3.2",
|
|
84
|
+
"vue-tsc": "2.0.17"
|
|
97
85
|
},
|
|
98
86
|
"peerDependencies": {
|
|
99
87
|
"@cucumber/cucumber": "^10.3.1",
|
|
100
88
|
"@jest/globals": "^29.5.0",
|
|
101
|
-
"@playwright/test": "^1.
|
|
89
|
+
"@playwright/test": "^1.43.1",
|
|
102
90
|
"@testing-library/vue": "^7.0.0 || ^8.0.1",
|
|
103
91
|
"@vitest/ui": "^0.34.6 || ^1.0.0",
|
|
104
92
|
"@vue/test-utils": "^2.4.2",
|
|
105
93
|
"h3": "*",
|
|
106
|
-
"happy-dom": "^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
|
|
94
|
+
"happy-dom": "^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
107
95
|
"jsdom": "^22.0.0 || ^23.0.0 || ^24.0.0",
|
|
108
|
-
"
|
|
96
|
+
"nitropack": "*",
|
|
97
|
+
"playwright-core": "^1.43.1",
|
|
109
98
|
"vite": "*",
|
|
110
99
|
"vitest": "^0.34.6 || ^1.0.0",
|
|
111
100
|
"vue": "^3.3.4",
|
|
@@ -144,15 +133,24 @@
|
|
|
144
133
|
}
|
|
145
134
|
},
|
|
146
135
|
"resolutions": {
|
|
147
|
-
"@
|
|
148
|
-
"@nuxt/
|
|
136
|
+
"@cucumber/cucumber": "10.7.0",
|
|
137
|
+
"@nuxt/kit": "^3.11.2",
|
|
138
|
+
"@nuxt/schema": "^3.11.2",
|
|
149
139
|
"@nuxt/test-utils": "workspace:*",
|
|
150
|
-
"rollup": "4.
|
|
151
|
-
"vite": "5.
|
|
152
|
-
"vue": "^3.4.
|
|
140
|
+
"rollup": "4.17.2",
|
|
141
|
+
"vite": "5.2.11",
|
|
142
|
+
"vue": "^3.4.27"
|
|
153
143
|
},
|
|
154
144
|
"engines": {
|
|
155
|
-
"node": "
|
|
145
|
+
"node": ">=18.19.0"
|
|
156
146
|
},
|
|
157
|
-
"
|
|
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"
|
|
155
|
+
}
|
|
158
156
|
}
|
package/playwright.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/playwright'
|