@nuxt/test-utils 3.6.2 → 3.6.4

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.
@@ -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.88b1fbfd.mjs';
3
+ import { $ as $fetch, u as useTestContext } from './shared/test-utils.92e8ff32.mjs';
4
4
  import 'execa';
5
5
  import 'get-port-please';
6
6
  import 'ofetch';
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import * as playwright from 'playwright';
2
- import { Browser, BrowserContextOptions, LaunchOptions } from 'playwright';
1
+ import * as playwright_core from 'playwright-core';
2
+ import { Browser, BrowserContextOptions, LaunchOptions } from 'playwright-core';
3
3
  import { NuxtConfig, Nuxt } from '@nuxt/schema';
4
4
  import { ExecaChildProcess } from 'execa';
5
5
  import { FetchOptions } from 'ofetch';
6
6
 
7
7
  declare function createBrowser(): Promise<void>;
8
8
  declare function getBrowser(): Promise<Browser>;
9
- declare function createPage(path?: string, options?: BrowserContextOptions): Promise<playwright.Page>;
9
+ declare function createPage(path?: string, options?: BrowserContextOptions): Promise<playwright_core.Page>;
10
10
 
11
11
  type TestRunner = 'vitest' | 'jest';
12
12
  interface TestOptions {
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.88b1fbfd.mjs';
2
- export { $ as $fetch, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv } from './shared/test-utils.88b1fbfd.mjs';
1
+ import { u as useTestContext, a as url, c as createTestContext, s as setTestContext, b as stopServer, d as startServer } from './shared/test-utils.92e8ff32.mjs';
2
+ export { $ as $fetch, e as exposeContextToEnv, f as fetch, i as isDev, r as recoverContextFromEnv } from './shared/test-utils.92e8ff32.mjs';
3
3
  import { consola } from 'consola';
4
4
  import { promises, existsSync } from 'node:fs';
5
5
  import { resolve } from 'node:path';
@@ -15,11 +15,11 @@ async function createBrowser() {
15
15
  const ctx = useTestContext();
16
16
  let playwright;
17
17
  try {
18
- playwright = await import(String("playwright"));
18
+ playwright = await import(String("playwright-core"));
19
19
  } catch {
20
20
  throw new Error(`
21
- The dependency 'playwright' not found.
22
- Please run 'yarn add --dev playwright' or 'npm install --save-dev playwright'
21
+ The dependency 'playwright-core' not found.
22
+ Please run 'yarn add --dev playwright-core' or 'npm install --save-dev playwright-core'
23
23
  `);
24
24
  }
25
25
  const { type, launch } = ctx.options.browserOptions;
@@ -72,6 +72,7 @@ async function startServer() {
72
72
  }
73
73
  });
74
74
  await waitForPort(port, { retries: 32 });
75
+ let lastError;
75
76
  for (let i = 0; i < 50; i++) {
76
77
  await new Promise((resolve2) => setTimeout(resolve2, 100));
77
78
  try {
@@ -79,11 +80,12 @@ async function startServer() {
79
80
  if (!res.includes("__NUXT_LOADING__")) {
80
81
  return;
81
82
  }
82
- } catch {
83
+ } catch (e) {
84
+ lastError = e;
83
85
  }
84
86
  }
85
87
  ctx.serverProcess.kill();
86
- throw new Error("Timeout waiting for dev server!");
88
+ throw lastError || new Error("Timeout waiting for dev server!");
87
89
  } else {
88
90
  ctx.serverProcess = execa("node", [
89
91
  resolve$1(ctx.nuxt.options.nitro.output.dir, "server/index.mjs")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/test-utils",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "repository": "nuxt/nuxt",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,33 +19,33 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "consola": "^3.2.2",
22
+ "consola": "^3.2.3",
23
23
  "defu": "^6.1.2",
24
24
  "execa": "^7.1.1",
25
25
  "get-port-please": "^3.0.1",
26
26
  "ofetch": "^1.1.1",
27
27
  "pathe": "^1.1.1",
28
28
  "ufo": "^1.1.2",
29
- "@nuxt/kit": "3.6.2",
30
- "@nuxt/schema": "3.6.2"
29
+ "@nuxt/kit": "3.6.4",
30
+ "@nuxt/schema": "3.6.4"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@jest/globals": "29.6.0",
34
- "playwright": "1.35.1",
34
+ "playwright-core": "1.35.1",
35
35
  "unbuild": "latest",
36
- "vitest": "0.32.4"
36
+ "vitest": "0.33.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@jest/globals": "^29.5.0",
40
- "playwright": "^1.34.3",
41
- "vitest": "^0.30.0 || ^0.31.0 || ^0.32.0",
40
+ "playwright-core": "^1.34.3",
41
+ "vitest": "^0.30.0 || ^0.31.0 || ^0.32.0 || ^0.33.0",
42
42
  "vue": "^3.3.4"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@jest/globals": {
46
46
  "optional": true
47
47
  },
48
- "playwright": {
48
+ "playwright-core": {
49
49
  "optional": true
50
50
  },
51
51
  "vitest": {