Skip to content

Commit

Permalink
fix: exclude OAPI components with setup() from the proxy mock workaround
Browse files Browse the repository at this point in the history
the test from b7be04a should now pass, as well as any other test from the suite.
  • Loading branch information
renatodeleao committed Jan 3, 2023
1 parent cc1bd39 commit 7b45b79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mount.ts
Expand Up @@ -482,7 +482,9 @@ 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 not include options API components in this this scenario
// since they can also have setup state.
if (hasSetupState(this) && this.$.setupState.__isScriptSetup) {
// add the mocks to setupState
for (const [k, v] of Object.entries(
global.mocks as { [key: string]: any }
Expand Down

0 comments on commit 7b45b79

Please sign in to comment.