@nuxt/test-utils 3.0.0-rc.6 → 3.0.0-rc.9

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 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;
@@ -49,6 +47,7 @@ interface TestHooks {
49
47
  declare function createTestContext(options: Partial<TestOptions>): TestContext;
50
48
  declare function useTestContext(): TestContext;
51
49
  declare function setTestContext(context: TestContext): TestContext;
50
+ declare function setTestContext(context?: TestContext): TestContext | undefined;
52
51
  declare function isDev(): boolean;
53
52
 
54
53
  declare function loadFixture(): Promise<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 { $fetch as $fetch$1, fetch as fetch$1 } from 'ohmyfetch';
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 availabe (is server option enabled?)");
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
- root: opts.rootDir,
274
- run: !opts.watch
275
- }, {
276
- esbuild: {
277
- tsconfigRaw: "{}"
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.6",
3
+ "version": "3.0.0-rc.9",
4
4
  "repository": "nuxt/framework",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,21 +13,21 @@
13
13
  "prepack": "unbuild"
14
14
  },
15
15
  "dependencies": {
16
- "@nuxt/kit": "^3.0.0-rc.6",
17
- "@nuxt/schema": "^3.0.0-rc.6",
18
- "defu": "^6.0.0",
16
+ "@nuxt/kit": "3.0.0-rc.9",
17
+ "@nuxt/schema": "3.0.0-rc.9",
18
+ "defu": "^6.1.0",
19
19
  "execa": "^6.1.0",
20
- "get-port-please": "^2.5.0",
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.23.4",
25
+ "playwright": "^1.25.1",
26
26
  "unbuild": "latest",
27
- "vitest": "^0.18.1"
27
+ "vitest": "~0.19.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "vue": "^3.2.37"
30
+ "vue": "^3.2.38"
31
31
  },
32
32
  "engines": {
33
33
  "node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0"