@nuxt/test-utils 3.10.0 → 3.11.0

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/module.mjs CHANGED
@@ -327,6 +327,7 @@ const module = defineNuxtModule({
327
327
  logToConsole: false
328
328
  },
329
329
  async setup(options, nuxt) {
330
+ var _a;
330
331
  if (nuxt.options.test || nuxt.options.dev) {
331
332
  setupImportMocking();
332
333
  }
@@ -335,6 +336,13 @@ const module = defineNuxtModule({
335
336
  entry: await resolvePath("#app/entry", { alias: nuxt.options.alias }),
336
337
  rootStubPath: await resolvePath(resolver.resolve("./runtime/nuxt-root"))
337
338
  }));
339
+ if (!nuxt.options.test && !nuxt.options.dev) {
340
+ (_a = nuxt.options.vite).define || (_a.define = {});
341
+ nuxt.options.vite.define["import.meta.vitest"] = "undefined";
342
+ }
343
+ nuxt.hook("prepare:types", ({ references }) => {
344
+ references.push({ types: "vitest/import-meta" });
345
+ });
338
346
  if (!nuxt.options.dev)
339
347
  return;
340
348
  if (process.env.TEST || process.env.VITE_TEST)
@@ -1,3 +1,4 @@
1
+ import { vi } from "vitest";
1
2
  if (typeof window !== "undefined" && // @ts-expect-error undefined property
2
3
  window.__NUXT_VITEST_ENVIRONMENT__) {
3
4
  const { useRouter } = await import("#app/composables/router");
@@ -5,5 +6,6 @@ window.__NUXT_VITEST_ENVIRONMENT__) {
5
6
  const nuxtApp = useNuxtApp();
6
7
  await nuxtApp.callHook("page:finish");
7
8
  useRouter().afterEach(() => nuxtApp.callHook("page:finish"));
9
+ vi.resetModules();
8
10
  }
9
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/test-utils",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/test-utils.git"
@@ -62,24 +62,24 @@
62
62
  "@types/estree": "1.0.5",
63
63
  "@types/jsdom": "21.1.6",
64
64
  "@types/semver": "7.5.6",
65
- "@vitest/ui": "1.1.1",
66
- "@vue/test-utils": "2.4.3",
65
+ "@vitest/ui": "1.2.2",
66
+ "@vue/test-utils": "2.4.4",
67
67
  "changelogen": "0.5.5",
68
68
  "eslint": "8.56.0",
69
69
  "eslint-plugin-import": "2.29.1",
70
- "eslint-plugin-jsdoc": "48.0.2",
70
+ "eslint-plugin-jsdoc": "48.0.4",
71
71
  "eslint-plugin-no-only-tests": "3.1.0",
72
72
  "eslint-plugin-unicorn": "50.0.1",
73
- "h3": "1.10.0",
73
+ "h3": "1.10.1",
74
74
  "jiti": "1.21.0",
75
75
  "nuxt": "3.9.3",
76
- "playwright-core": "1.41.0",
77
- "rollup": "4.9.5",
76
+ "playwright-core": "1.41.1",
77
+ "rollup": "4.9.6",
78
78
  "semver": "7.5.4",
79
79
  "unbuild": "latest",
80
80
  "unimport": "3.7.1",
81
- "vite": "5.0.11",
82
- "vitest": "1.1.1",
81
+ "vite": "5.0.12",
82
+ "vitest": "1.2.2",
83
83
  "vue-router": "4.2.5",
84
84
  "vue-tsc": "1.8.27"
85
85
  },
@@ -91,7 +91,7 @@
91
91
  "@vue/test-utils": "^2.4.2",
92
92
  "h3": "*",
93
93
  "happy-dom": "^9.10.9 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
94
- "jsdom": "^22.0.0 || ^23.0.0",
94
+ "jsdom": "^22.0.0 || ^23.0.0 || ^24.0.0",
95
95
  "playwright-core": "^1.34.3",
96
96
  "vite": "*",
97
97
  "vitest": "^0.34.6 || ^1.0.0",
@@ -128,17 +128,17 @@
128
128
  }
129
129
  },
130
130
  "resolutions": {
131
- "@nuxt/schema": "^3.9.3",
132
131
  "@nuxt/kit": "^3.9.3",
132
+ "@nuxt/schema": "^3.9.3",
133
133
  "@nuxt/test-utils": "workspace:*",
134
- "rollup": "4.9.5",
135
- "vite": "5.0.11",
136
- "vue": "^3.4.14"
134
+ "rollup": "4.9.6",
135
+ "vite": "5.0.12",
136
+ "vue": "^3.4.15"
137
137
  },
138
138
  "engines": {
139
139
  "node": "^14.18.0 || >=16.10.0"
140
140
  },
141
- "packageManager": "pnpm@8.14.1",
141
+ "packageManager": "pnpm@8.15.0",
142
142
  "scripts": {
143
143
  "lint": "eslint --ext .vue,.ts,.js,.mjs .",
144
144
  "lint:fix": "eslint --ext .vue,.ts,.js,.mjs . --fix",