From b130d6f648239293457f347b42a7f1b668748d30 Mon Sep 17 00:00:00 2001 From: Kirill Romanov Date: Fri, 26 Nov 2021 20:28:09 +0300 Subject: [PATCH] fix(testing): preserve non-enumerable properties of pinia instance in createTestingPinia (#841) --- packages/testing/src/testing.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/testing/src/testing.ts b/packages/testing/src/testing.ts index 201414a5..a2cea05e 100644 --- a/packages/testing/src/testing.ts +++ b/packages/testing/src/testing.ts @@ -93,12 +93,13 @@ export function createTestingPinia({ setActivePinia(pinia) - return Object.assign( - { - get app(): App { - return (this as TestingPinia)._a - }, + Object.defineProperty(pinia, 'app', { + configurable: true, + enumerable: true, + get(): App { + return this._a }, - pinia - ) + }) + + return pinia as TestingPinia } -- 2.47.3