@nuxt/test-utils 3.14.3 → 3.14.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.
package/dist/e2e.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { d as distDir } from './shared/test-utils.CaqvQLs_.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.CaqvQLs_.mjs';
3
- import { u as useTestContext } from './shared/test-utils.ClQ9CUdo.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.ClQ9CUdo.mjs';
1
+ import { d as distDir } from './shared/test-utils.B9x0-cXO.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.B9x0-cXO.mjs';
3
+ import { u as useTestContext } from './shared/test-utils.BHdilg2X.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.BHdilg2X.mjs';
5
5
  import { consola } from 'consola';
6
6
  import { resolve } from 'pathe';
7
7
  import 'node:fs';
@@ -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.ClQ9CUdo.mjs';
3
+ import { $ as $fetch, u as useTestContext } from './shared/test-utils.BHdilg2X.mjs';
4
4
  import 'tinyexec';
5
5
  import 'get-port-please';
6
6
  import 'ofetch';
@@ -1,13 +1,13 @@
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.CaqvQLs_.mjs';
3
+ import { e as createTest, w as waitForHydration } from './shared/test-utils.B9x0-cXO.mjs';
4
4
  import 'node:path';
5
5
  import 'defu';
6
6
  import 'ufo';
7
7
  import 'consola';
8
8
  import 'node:fs';
9
9
  import '@nuxt/kit';
10
- import { d as url } from './shared/test-utils.ClQ9CUdo.mjs';
10
+ import { d as url } from './shared/test-utils.BHdilg2X.mjs';
11
11
  import 'pathe';
12
12
  import 'node:url';
13
13
  import 'tinyexec';
@@ -137,7 +137,7 @@ async function mountSuspended(component, options) {
137
137
  }
138
138
  if (methods && typeof methods === "object") {
139
139
  for (const key in methods) {
140
- renderContext[key] = methods[key];
140
+ renderContext[key] = methods[key].bind(renderContext);
141
141
  }
142
142
  }
143
143
  if (computed && typeof computed === "object") {
@@ -269,7 +269,7 @@ async function renderSuspended(component, options) {
269
269
  }
270
270
  if (methods && typeof methods === "object") {
271
271
  for (const key in methods) {
272
- renderContext[key] = methods[key];
272
+ renderContext[key] = methods[key].bind(renderContext);
273
273
  }
274
274
  }
275
275
  if (computed && typeof computed === "object") {
@@ -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.ClQ9CUdo.mjs';
1
+ import { u as useTestContext, d as url, c as createTestContext, s as setTestContext, b as stopServer, a as startServer } from './test-utils.BHdilg2X.mjs';
2
2
  import { existsSync, promises } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
4
  import { defu } from 'defu';
@@ -9,6 +9,7 @@ import { defu } from 'defu';
9
9
 
10
10
  let currentContext;
11
11
  function createTestContext(options) {
12
+ var _a;
12
13
  const _options = defu(options, {
13
14
  testDir: resolve(process.cwd(), "test"),
14
15
  fixture: "fixture",
@@ -18,6 +19,7 @@ function createTestContext(options) {
18
19
  logLevel: 1,
19
20
  server: true,
20
21
  build: options.browser !== false || options.server !== false,
22
+ env: {},
21
23
  nuxtConfig: {
22
24
  // suppress compatibility date warning for runtime environment tests
23
25
  compatibilityDate: "2024-04-03"
@@ -26,6 +28,9 @@ function createTestContext(options) {
26
28
  type: "chromium"
27
29
  }
28
30
  });
31
+ if (!_options.dev) {
32
+ (_a = _options.env).NODE_ENV || (_a.NODE_ENV = "production");
33
+ }
29
34
  if (_options.host) {
30
35
  _options.build = false;
31
36
  _options.server = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/test-utils",
3
- "version": "3.14.3",
3
+ "version": "3.14.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/test-utils.git"
@@ -50,15 +50,15 @@
50
50
  "fake-indexeddb": "^6.0.0",
51
51
  "get-port-please": "^3.1.2",
52
52
  "local-pkg": "^0.5.0",
53
- "magic-string": "^0.30.11",
53
+ "magic-string": "^0.30.12",
54
54
  "node-fetch-native": "^1.6.4",
55
- "ofetch": "^1.4.0",
55
+ "ofetch": "^1.4.1",
56
56
  "pathe": "^1.1.2",
57
57
  "perfect-debounce": "^1.0.0",
58
58
  "radix3": "^1.1.2",
59
59
  "scule": "^1.3.0",
60
60
  "std-env": "^3.7.0",
61
- "tinyexec": "^0.3.0",
61
+ "tinyexec": "^0.3.1",
62
62
  "ufo": "^1.5.4",
63
63
  "unenv": "^1.10.0",
64
64
  "unplugin": "^1.14.1",
@@ -68,30 +68,30 @@
68
68
  "@cucumber/cucumber": "11.0.1",
69
69
  "@jest/globals": "29.7.0",
70
70
  "@nuxt/devtools": "1.0.8",
71
- "@nuxt/eslint-config": "0.5.7",
71
+ "@nuxt/eslint-config": "0.6.0",
72
72
  "@nuxt/module-builder": "0.8.4",
73
- "@playwright/test": "1.47.2",
73
+ "@playwright/test": "1.48.1",
74
74
  "@testing-library/vue": "8.1.0",
75
75
  "@types/estree": "1.0.6",
76
76
  "@types/jsdom": "21.1.7",
77
77
  "@types/semver": "7.5.8",
78
- "@vitest/ui": "2.1.2",
78
+ "@vitest/ui": "2.1.3",
79
79
  "@vue/test-utils": "2.4.6",
80
80
  "changelogen": "0.5.7",
81
81
  "compatx": "0.1.8",
82
- "eslint": "9.12.0",
82
+ "eslint": "9.13.0",
83
83
  "h3": "1.13.0",
84
- "jiti": "2.3.1",
84
+ "jiti": "2.3.3",
85
85
  "nitropack": "2.9.7",
86
86
  "nuxt": "3.13.2",
87
- "playwright-core": "1.47.2",
87
+ "playwright-core": "1.48.1",
88
88
  "rollup": "4.24.0",
89
89
  "semver": "7.6.3",
90
- "typescript": "5.6.2",
90
+ "typescript": "5.6.3",
91
91
  "unbuild": "latest",
92
92
  "unimport": "3.13.1",
93
- "vite": "5.4.8",
94
- "vitest": "2.1.2",
93
+ "vite": "5.4.9",
94
+ "vitest": "2.1.3",
95
95
  "vue-router": "4.4.5",
96
96
  "vue-tsc": "2.1.6"
97
97
  },
@@ -151,13 +151,13 @@
151
151
  "@nuxt/schema": "^3.13.2",
152
152
  "@nuxt/test-utils": "workspace:*",
153
153
  "rollup": "4.24.0",
154
- "vite": "5.4.8",
155
- "vite-node": "2.1.2",
156
- "vitest": "2.1.2",
157
- "vue": "^3.5.11"
154
+ "vite": "5.4.9",
155
+ "vite-node": "2.1.3",
156
+ "vitest": "2.1.3",
157
+ "vue": "^3.5.12"
158
158
  },
159
159
  "engines": {
160
160
  "node": ">=18.20.4"
161
161
  },
162
- "packageManager": "pnpm@9.12.0"
162
+ "packageManager": "pnpm@9.12.2"
163
163
  }