@nuxt/test-utils-nightly 3.8.2-1701553126.bbd67b2 → 3.8.2-1701554764.180bb30
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 +2 -1
- package/dist/runtime/entry.mjs +1 -0
- package/package.json +1 -1
package/dist/module.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import MagicString from 'magic-string';
|
|
|
12
12
|
import { normalize, resolve } from 'node:path';
|
|
13
13
|
import { createUnplugin } from 'unplugin';
|
|
14
14
|
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { join, dirname } from 'pathe';
|
|
15
16
|
|
|
16
17
|
const PLUGIN_NAME$1 = "nuxt:vitest:mock-transform";
|
|
17
18
|
const HELPER_MOCK_IMPORT = "mockNuxtImport";
|
|
@@ -307,7 +308,7 @@ const NuxtRootStubPlugin = createUnplugin((options) => {
|
|
|
307
308
|
vite: {
|
|
308
309
|
async resolveId(id) {
|
|
309
310
|
if (id.endsWith("nuxt-vitest-app-entry")) {
|
|
310
|
-
return
|
|
311
|
+
return join(dirname(options.entry), "nuxt-vitest-app-entry");
|
|
311
312
|
}
|
|
312
313
|
},
|
|
313
314
|
async load(id) {
|
package/dist/runtime/entry.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
if (typeof window !== "undefined" && // @ts-expect-error undefined property
|
|
2
2
|
window.__NUXT_VITEST_ENVIRONMENT__) {
|
|
3
|
+
const { useRouter } = await import("#app/composables/router");
|
|
3
4
|
await import("#app/nuxt-vitest-app-entry").then((r) => r.default());
|
|
4
5
|
const nuxtApp = useNuxtApp();
|
|
5
6
|
await nuxtApp.callHook("page:finish");
|