]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(testing): preserve non-enumerable properties of pinia instance in createTestingPi...
authorKirill Romanov <djaler1@gmail.com>
Fri, 26 Nov 2021 17:28:09 +0000 (20:28 +0300)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 17:28:09 +0000 (18:28 +0100)
packages/testing/src/testing.ts

index 201414a52ea4bfd57987e67df58f9a7761a8ca0a..a2cea05e951952037bce24255f94bdc9326b6ef7 100644 (file)
@@ -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
 }