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 aec9623
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit aec9623

Please sign in to comment.