@nuxt/test-utils 3.7.0 β 3.7.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/README.md
CHANGED
|
@@ -1,113 +1,52 @@
|
|
|
1
|
+
[](https://nuxt.com)
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
# Nuxt
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
|
|
8
|
+
<a href="./LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
|
|
9
|
+
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt.js" alt="Website"></a>
|
|
10
|
+
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
11
|
+
</p>
|
|
5
12
|
|
|
13
|
+
Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
It provides a number of features that make it easy to build fast, SEO-friendly, and scalable web applications, including:
|
|
16
|
+
- Server-side rendering, Static Site Generation or Hybrid Rendering
|
|
17
|
+
- Automatic routing with code-splitting
|
|
18
|
+
- State management
|
|
19
|
+
- SEO Optimization
|
|
20
|
+
- Extandable with [100+ modules](https://nuxt.com/modules)
|
|
21
|
+
- Deployment to a variety of hosting platforms
|
|
22
|
+
- ...[and much more](https://nuxt.com) π
|
|
8
23
|
|
|
24
|
+
## Getting Started
|
|
9
25
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
We highly recommend you take a look at <a href="https://nuxt.com">the Nuxt documentation</a> to level up.
|
|
35
|
-
</p>
|
|
36
|
-
</td>
|
|
37
|
-
</tr>
|
|
38
|
-
<tr>
|
|
39
|
-
<td width="80" align="center" valign="top">
|
|
40
|
-
<br>
|
|
41
|
-
<a href="https://nuxt.com/modules"><img src="./.github/assets/modules.png"></a>
|
|
42
|
-
</td>
|
|
43
|
-
<td valign="top">
|
|
44
|
-
<h3>Modules</h3>
|
|
45
|
-
<p>
|
|
46
|
-
Discover our <a href="https://nuxt.com/modules">list of modules</a> to supercharge your Nuxt project. Created by the Nuxt team and community.
|
|
47
|
-
</p>
|
|
48
|
-
</td>
|
|
49
|
-
</tr>
|
|
50
|
-
<tr>
|
|
51
|
-
<td width="80" align="center" valign="top">
|
|
52
|
-
<br>
|
|
53
|
-
<a href="https://nuxt.com/docs/examples/hello-world"><img src="./.github/assets/examples.png"></a>
|
|
54
|
-
</td>
|
|
55
|
-
<td>
|
|
56
|
-
<h3>Examples</h3>
|
|
57
|
-
<p>
|
|
58
|
-
Explore different ways of using Nuxt features and get inspired with <a href="https://nuxt.com/docs/examples/hello-world">our list of examples</a>.
|
|
59
|
-
</p>
|
|
60
|
-
</td>
|
|
61
|
-
</tr>
|
|
62
|
-
</tbody>
|
|
63
|
-
</table>
|
|
64
|
-
|
|
65
|
-
<table>
|
|
66
|
-
<thead>
|
|
67
|
-
<tr>
|
|
68
|
-
<th width="2000" colspan="2">
|
|
69
|
-
</th>
|
|
70
|
-
</tr>
|
|
71
|
-
</thead>
|
|
72
|
-
<tbody>
|
|
73
|
-
<tr>
|
|
74
|
-
<td width="80" align="center" valign="top">
|
|
75
|
-
<br>
|
|
76
|
-
<a href="https://nuxt.com/docs/community/reporting-bugs"><img src="./.github/assets/reporting-bugs.png"></a>
|
|
77
|
-
</td>
|
|
78
|
-
<td valign="top">
|
|
79
|
-
<h3>Reporting bugs</h3>
|
|
80
|
-
<p>
|
|
81
|
-
Check out the <a href="https://nuxt.com/docs/community/reporting-bugs">Reporting Bugs</a> page.</p>
|
|
82
|
-
</p>
|
|
83
|
-
</td>
|
|
84
|
-
</tr>
|
|
85
|
-
<tr>
|
|
86
|
-
<td width="80" align="center" valign="top">
|
|
87
|
-
<br>
|
|
88
|
-
<a href="https://nuxt.com/docs/community/contribution"><img src="./.github/assets/suggestions.png"></a>
|
|
89
|
-
</td>
|
|
90
|
-
<td valign="top">
|
|
91
|
-
<h3>Suggestions</h3>
|
|
92
|
-
<p>
|
|
93
|
-
Check out the <a href="https://nuxt.com/docs/community/contribution">Contribution</a> page.
|
|
94
|
-
</p>
|
|
95
|
-
</td>
|
|
96
|
-
</tr>
|
|
97
|
-
<tr>
|
|
98
|
-
<td width="80" align="center" valign="top">
|
|
99
|
-
<br>
|
|
100
|
-
<a href="https://nuxt.com/docs/community/getting-help"><img src="./.github/assets/questions.png"></a>
|
|
101
|
-
</td>
|
|
102
|
-
<td valign="top">
|
|
103
|
-
<h3>Questions</h3>
|
|
104
|
-
<p>
|
|
105
|
-
Check out the <a href="https://nuxt.com/docs/community/getting-help">Getting Help</a> page.
|
|
106
|
-
</p>
|
|
107
|
-
</td>
|
|
108
|
-
</tr>
|
|
109
|
-
</tbody>
|
|
110
|
-
</table>
|
|
26
|
+
Use the following command to create a new starter project. This will create a starter project with all the necessary files and dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx nuxi@latest init <my-project>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Discover also [nuxt.new](https://nuxt.new): Open a Nuxt starter on CodeSandbox, StackBlitz or locally to get up and running in a few seconds.
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
We highly recommend you take a look at the [Nuxt documentation](https://nuxt.com/docs) to level up. Itβs a great resource for learning more about the framework. It covers everything from getting started to advanced topics.
|
|
37
|
+
|
|
38
|
+
## Modules
|
|
39
|
+
|
|
40
|
+
Discover our [list of modules](https://nuxt.com/modules) to supercharge your Nuxt project, created by the Nuxt team and community.
|
|
41
|
+
|
|
42
|
+
## Contribute
|
|
43
|
+
|
|
44
|
+
We invite you to contribute and help improve Nuxt π
|
|
45
|
+
|
|
46
|
+
Here are a few ways you can get involved:
|
|
47
|
+
- **Reporting Bugs:** If you come across any bugs or issues, please check out the [reporting bugs guide](https://nuxt.com/docs/community/reporting-bugs) to learn how to submit a bug report.
|
|
48
|
+
- **Suggestions:** Have ideas to enhance Nuxt? We'd love to hear them! Check out the [contribution guide](https://nuxt.com/docs/community/contribution#creating-an-issue) to share your suggestions.
|
|
49
|
+
- **Questions:** If you have questions or need assistance, the [getting help guide](https://nuxt.com/docs/community/getting-help) provides resources to help you out.
|
|
111
50
|
|
|
112
51
|
## Local Development
|
|
113
52
|
|
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.8f432eb9.mjs';
|
|
4
4
|
import 'execa';
|
|
5
5
|
import 'get-port-please';
|
|
6
6
|
import 'ofetch';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as useTestContext, a as url, c as createTestContext, s as setTestContext, b as stopServer, d as startServer } from './shared/test-utils.
|
|
2
|
-
export { $ as $fetch, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv } from './shared/test-utils.
|
|
1
|
+
import { u as useTestContext, a as url, c as createTestContext, s as setTestContext, b as stopServer, d as startServer } from './shared/test-utils.8f432eb9.mjs';
|
|
2
|
+
export { $ as $fetch, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv } from './shared/test-utils.8f432eb9.mjs';
|
|
3
3
|
import { consola } from 'consola';
|
|
4
4
|
import { promises, existsSync } from 'node:fs';
|
|
5
5
|
import { resolve } from 'node:path';
|
|
@@ -57,8 +57,9 @@ const kit = _kit.default || _kit;
|
|
|
57
57
|
async function startServer() {
|
|
58
58
|
const ctx = useTestContext();
|
|
59
59
|
await stopServer();
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const host = "127.0.0.1";
|
|
61
|
+
const port = ctx.options.port || await getRandomPort(host);
|
|
62
|
+
ctx.url = `http://${host}:${port}`;
|
|
62
63
|
if (ctx.options.dev) {
|
|
63
64
|
const nuxiCLI = await kit.resolvePath("nuxi/cli");
|
|
64
65
|
ctx.serverProcess = execa(nuxiCLI, ["_dev"], {
|
|
@@ -67,12 +68,14 @@ async function startServer() {
|
|
|
67
68
|
env: {
|
|
68
69
|
...process.env,
|
|
69
70
|
_PORT: String(port),
|
|
71
|
+
// Used by internal _dev command
|
|
70
72
|
PORT: String(port),
|
|
71
|
-
|
|
73
|
+
HOST: host,
|
|
72
74
|
NODE_ENV: "development"
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
|
-
await waitForPort(port, { retries: 32 })
|
|
77
|
+
await waitForPort(port, { retries: 32, host }).catch(() => {
|
|
78
|
+
});
|
|
76
79
|
let lastError;
|
|
77
80
|
for (let i = 0; i < 150; i++) {
|
|
78
81
|
await new Promise((resolve2) => setTimeout(resolve2, 100));
|
|
@@ -95,11 +98,11 @@ async function startServer() {
|
|
|
95
98
|
env: {
|
|
96
99
|
...process.env,
|
|
97
100
|
PORT: String(port),
|
|
98
|
-
|
|
101
|
+
HOST: host,
|
|
99
102
|
NODE_ENV: "test"
|
|
100
103
|
}
|
|
101
104
|
});
|
|
102
|
-
await waitForPort(port, { retries:
|
|
105
|
+
await waitForPort(port, { retries: 20, host });
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
async function stopServer() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/test-utils",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"repository": "nuxt/nuxt",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"consola": "^3.2.3",
|
|
23
23
|
"defu": "^6.1.2",
|
|
24
24
|
"execa": "^7.2.0",
|
|
25
|
-
"get-port-please": "^3.
|
|
25
|
+
"get-port-please": "^3.1.1",
|
|
26
26
|
"ofetch": "^1.3.3",
|
|
27
27
|
"pathe": "^1.1.1",
|
|
28
28
|
"ufo": "^1.3.0",
|
|
29
|
-
"@nuxt/kit": "3.7.
|
|
30
|
-
"@nuxt/schema": "3.7.
|
|
29
|
+
"@nuxt/kit": "3.7.2",
|
|
30
|
+
"@nuxt/schema": "3.7.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@jest/globals": "29.
|
|
33
|
+
"@jest/globals": "29.7.0",
|
|
34
34
|
"playwright-core": "1.37.1",
|
|
35
35
|
"unbuild": "latest",
|
|
36
36
|
"vitest": "0.33.0"
|