@nuxt/test-utils-nightly 3.21.0-20251031-123045-c452751 → 3.21.0-20251103-141132-dc46354
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/runtime-utils/index.mjs +18 -0
- package/package.json +1 -1
|
@@ -121,6 +121,14 @@ async function mountSuspended(component, options) {
|
|
|
121
121
|
}
|
|
122
122
|
currentInstance.emit = getInterceptedEmitFunction(currentInstance.emit);
|
|
123
123
|
}
|
|
124
|
+
function patchInstanceAppContext() {
|
|
125
|
+
const app = getCurrentInstance()?.appContext.app;
|
|
126
|
+
if (!app) return;
|
|
127
|
+
for (const [key, value] of Object.entries(vueApp)) {
|
|
128
|
+
if (key in app) continue;
|
|
129
|
+
app[key] = value;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
124
132
|
let passedProps;
|
|
125
133
|
let componentScope = null;
|
|
126
134
|
const wrappedSetup = async (props2, setupContext2) => {
|
|
@@ -150,6 +158,7 @@ async function mountSuspended(component, options) {
|
|
|
150
158
|
{
|
|
151
159
|
__cssModules: componentRest.__cssModules,
|
|
152
160
|
setup: (props2, ctx) => {
|
|
161
|
+
patchInstanceAppContext();
|
|
153
162
|
setupContext = ctx;
|
|
154
163
|
if (options?.scoped) {
|
|
155
164
|
const scope = effectScope();
|
|
@@ -353,6 +362,14 @@ async function renderSuspended(component, options) {
|
|
|
353
362
|
}
|
|
354
363
|
currentInstance.emit = getInterceptedEmitFunction(currentInstance.emit);
|
|
355
364
|
}
|
|
365
|
+
function patchInstanceAppContext() {
|
|
366
|
+
const app = getCurrentInstance()?.appContext.app;
|
|
367
|
+
if (!app) return;
|
|
368
|
+
for (const [key, value] of Object.entries(vueApp)) {
|
|
369
|
+
if (key in app) continue;
|
|
370
|
+
app[key] = value;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
356
373
|
for (const fn of window.__cleanup || []) {
|
|
357
374
|
fn();
|
|
358
375
|
}
|
|
@@ -378,6 +395,7 @@ async function renderSuspended(component, options) {
|
|
|
378
395
|
{
|
|
379
396
|
__cssModules: componentRest.__cssModules,
|
|
380
397
|
setup: (props2, ctx) => {
|
|
398
|
+
patchInstanceAppContext();
|
|
381
399
|
setupContext = ctx;
|
|
382
400
|
const scope = effectScope();
|
|
383
401
|
window.__cleanup ||= [];
|