From aec962350f7902a67d25e097e1f34acda24274b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renato=20de=20Le=C3=A3o?= Date: Tue, 3 Jan 2023 18:48:09 +0000 Subject: [PATCH] fix: exclude OAPI components with setup() from the proxy mock workaround the test from b7be04a should now pass, as well as any other test from the suite. --- src/mount.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mount.ts b/src/mount.ts index 27735767c..bff98a23e 100644 --- a/src/mount.ts +++ b/src/mount.ts @@ -482,7 +482,10 @@ export function mount( // otherwise we run into a proxy set error // due to https://github.com/vuejs/core/commit/f73925d76a76ee259749b8b48cb68895f539a00f#diff-ea4d1ddabb7e22e17e80ada458eef70679af4005df2a1a6b73418fec897603ceR404 // introduced in Vue v3.2.45 - if (hasSetupState(this)) { + // Also ensures not to include option API components in this this block + // since they can also have setup state but need to be patched using + // the regular method. + if (hasSetupState(this) && this.$.setupState.__isScriptSetup) { // add the mocks to setupState for (const [k, v] of Object.entries( global.mocks as { [key: string]: any }