Skip to content

Commit b130d6f

Browse files
authored
fix(testing): preserve non-enumerable properties of pinia instance in createTestingPinia (#841)
1 parent f342946 commit b130d6f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/testing/src/testing.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@ export function createTestingPinia({
9393

9494
setActivePinia(pinia)
9595

96-
return Object.assign(
97-
{
98-
get app(): App {
99-
return (this as TestingPinia)._a
100-
},
96+
Object.defineProperty(pinia, 'app', {
97+
configurable: true,
98+
enumerable: true,
99+
get(): App {
100+
return this._a
101101
},
102-
pinia
103-
)
102+
})
103+
104+
return pinia as TestingPinia
104105
}

0 commit comments

Comments
 (0)