Repository: vuejs/composition-api (ts)

Issue:
Warnings In Tests When Using createLocalVue() From vue-test-utils
When using any of the 1.0.0 betas, a lot of warnings get printed during tests. This is caused by code like this:

```ts
import VueCompositionAPI from "@vue/composition-api";
import { createLocalVue } from "@vue/test-utils";
import range from "lodash/range";
import { VueConstructor } from "vue";

describe("warnings", () => {
  let localVue: VueConstructor;

  beforeEach(() => {
    localVue = createLocalVue();
    localVue.use(VueCompositionAPI);
  });

  test.each(range(5))("create localVue 5 times", () => {
    expect(localVue).toBeDefined();
  });
});

```
The printed warning will look like this:
```
 [Vue warn]: Another instance of vue installed
```

Is there anything that could be done to silence those warnings? The issue seems to be related to https://github.com/vuejs/composition-api/issues/492

Pull request description:
fix(vue-test): prevent warning when using multiple `localVue`
fix #530 

Patch:
diff --git a/src/runtimeContext.ts b/src/runtimeContext.ts
index 4535be1..e718eb5 100644
--- a/src/runtimeContext.ts
+++ b/src/runtimeContext.ts
@@ -46,7 +46,8 @@ export function getRegisteredVueOrDefault(): VueConstructor {
 }
 
 export function setVueConstructor(Vue: VueConstructor) {
-  if (__DEV__ && vueConstructor) {
+  // @ts-ignore
+  if (__DEV__ && vueConstructor && Vue.__proto__ !== vueConstructor.__proto__) {
     warn('Another instance of vue installed')
   }
   vueConstructor = Vue


Test patch:
diff --git a/test/use.spec.ts b/test/use.spec.ts
index da2043c..8e02921 100644
--- a/test/use.spec.ts
+++ b/test/use.spec.ts
@@ -1,3 +1,4 @@
+import Vue from 'vue'
 import CompositionApi from '../src'
 import { createLocalVue } from './helpers/create-local-vue'
 import { mockWarn } from './helpers'
@@ -12,7 +13,26 @@ describe('use', () => {
     const localVueTwo = createLocalVue()
     localVueTwo.use(CompositionApi)
 
-    expect('Another instance of vue installed').toHaveBeenWarned()
+    expect('Another instance of vue installed').not.toHaveBeenWarned()
+  })
+
+  it('should warn install in multiple vue', () => {
+    try {
+      const fakeVue = {
+        version: '2._.x',
+        config: {
+          optionMergeStrategies: {},
+        },
+        mixin: jest.fn(),
+      }
+
+      // @ts-ignore
+      CompositionApi.install(fakeVue)
+      expect('Another instance of vue installed').toHaveBeenWarned()
+    } finally {
+      Vue.use(CompositionApi)
+      expect('Another instance of vue installed').toHaveBeenWarned()
+    }
   })
 
   it('should warn installing multiple times', () => {
@@ -29,7 +49,5 @@ describe('use', () => {
     }).toThrowError(
       'already installed. Vue.use(VueCompositionAPI) should be called only once.'
     )
-
-    expect('Another instance of vue installed').toHaveBeenWarned()
   })
 })