@nuxt/test-utils 3.0.0-rc.5 → 3.0.0-rc.8
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/index.d.ts +0 -2
- package/dist/index.mjs +13 -12
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as playwright_core from 'playwright-core';
|
|
|
2
2
|
import { Browser, BrowserContextOptions, LaunchOptions } from 'playwright';
|
|
3
3
|
import { NuxtConfig, Nuxt } from '@nuxt/schema';
|
|
4
4
|
import { ExecaChildProcess } from 'execa';
|
|
5
|
-
import { Listener } from 'listhen';
|
|
6
5
|
import { FetchOptions } from 'ohmyfetch';
|
|
7
6
|
|
|
8
7
|
declare function createBrowser(): Promise<void>;
|
|
@@ -36,7 +35,6 @@ interface TestContext {
|
|
|
36
35
|
browser?: Browser;
|
|
37
36
|
url?: string;
|
|
38
37
|
serverProcess?: ExecaChildProcess;
|
|
39
|
-
listener?: Listener;
|
|
40
38
|
}
|
|
41
39
|
interface TestHooks {
|
|
42
40
|
beforeEach: () => void;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from 'node:path';
|
|
|
2
2
|
import defu from 'defu';
|
|
3
3
|
import { execa } from 'execa';
|
|
4
4
|
import { getRandomPort, waitForPort } from 'get-port-please';
|
|
5
|
-
import {
|
|
5
|
+
import { fetch as fetch$1, $fetch as $fetch$1 } from 'ohmyfetch';
|
|
6
6
|
import * as _kit from '@nuxt/kit';
|
|
7
7
|
import { promises, existsSync } from 'node:fs';
|
|
8
8
|
|
|
@@ -88,9 +88,6 @@ async function stopServer() {
|
|
|
88
88
|
if (ctx.serverProcess) {
|
|
89
89
|
await ctx.serverProcess.kill();
|
|
90
90
|
}
|
|
91
|
-
if (ctx.listener) {
|
|
92
|
-
await ctx.listener.close();
|
|
93
|
-
}
|
|
94
91
|
}
|
|
95
92
|
function fetch(path, options) {
|
|
96
93
|
return fetch$1(url(path), options);
|
|
@@ -101,7 +98,7 @@ function $fetch(path, options) {
|
|
|
101
98
|
function url(path) {
|
|
102
99
|
const ctx = useTestContext();
|
|
103
100
|
if (!ctx.url) {
|
|
104
|
-
throw new Error("url is not
|
|
101
|
+
throw new Error("url is not available (is server option enabled?)");
|
|
105
102
|
}
|
|
106
103
|
return ctx.url + path;
|
|
107
104
|
}
|
|
@@ -269,14 +266,18 @@ async function runTests(opts) {
|
|
|
269
266
|
process.env.NUXT_TEST_DEV = "true";
|
|
270
267
|
}
|
|
271
268
|
const { startVitest } = await import('vitest/dist/node.mjs');
|
|
272
|
-
const succeeded = await startVitest(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
269
|
+
const succeeded = await startVitest(
|
|
270
|
+
[],
|
|
271
|
+
{
|
|
272
|
+
root: opts.rootDir,
|
|
273
|
+
run: !opts.watch
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
esbuild: {
|
|
277
|
+
tsconfigRaw: "{}"
|
|
278
|
+
}
|
|
278
279
|
}
|
|
279
|
-
|
|
280
|
+
);
|
|
280
281
|
if (!succeeded) {
|
|
281
282
|
process.exit(1);
|
|
282
283
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/test-utils",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.8",
|
|
4
4
|
"repository": "nuxt/framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
"prepack": "unbuild"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@nuxt/kit": "
|
|
17
|
-
"@nuxt/schema": "
|
|
16
|
+
"@nuxt/kit": "3.0.0-rc.8",
|
|
17
|
+
"@nuxt/schema": "3.0.0-rc.8",
|
|
18
18
|
"defu": "^6.0.0",
|
|
19
19
|
"execa": "^6.1.0",
|
|
20
|
-
"get-port-please": "^2.
|
|
20
|
+
"get-port-please": "^2.6.1",
|
|
21
21
|
"jiti": "^1.14.0",
|
|
22
22
|
"ohmyfetch": "^0.4.18"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"playwright": "^1.
|
|
25
|
+
"playwright": "^1.25.0",
|
|
26
26
|
"unbuild": "latest",
|
|
27
|
-
"vitest": "
|
|
27
|
+
"vitest": "~0.19.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"vue": "^3.2.37"
|