]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: move mockWarn utility to @vue/shared
authorEvan You <yyx990803@gmail.com>
Wed, 22 Jan 2020 14:29:35 +0000 (09:29 -0500)
committerEvan You <yyx990803@gmail.com>
Wed, 22 Jan 2020 14:29:45 +0000 (09:29 -0500)
close #652

20 files changed:
packages/compiler-sfc/__tests__/compileStyle.spec.ts
packages/compiler-sfc/__tests__/parse.spec.ts
packages/reactivity/__tests__/computed.spec.ts
packages/reactivity/__tests__/reactive.spec.ts
packages/reactivity/__tests__/readonly.spec.ts
packages/runtime-core/__tests__/apiApp.spec.ts
packages/runtime-core/__tests__/apiInject.spec.ts
packages/runtime-core/__tests__/apiOptions.spec.ts
packages/runtime-core/__tests__/apiWatch.spec.ts
packages/runtime-core/__tests__/componentProxy.spec.ts
packages/runtime-core/__tests__/errorHandling.spec.ts
packages/runtime-core/__tests__/helpers/resolveAssets.spec.ts
packages/runtime-core/__tests__/helpers/toHandlers.spec.ts
packages/runtime-core/__tests__/rendererAttrsFallthrough.spec.ts
packages/runtime-core/__tests__/rendererChildren.spec.ts
packages/runtime-test/__tests__/testRuntime.spec.ts
packages/runtime-test/src/index.ts
packages/shared/src/index.ts
packages/shared/src/mockWarn.ts [moved from packages/runtime-test/src/utils/mockWarn.ts with 100% similarity]
packages/vue/__tests__/index.spec.ts

index 5198e7a7e34dee19d0c926e1522f6ea862db513c..b4af3c0972db43a70fa8881fd8604cbbaa45f1a2 100644 (file)
@@ -1,5 +1,5 @@
 import { compileStyle } from '../src/compileStyle'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 function compile(source: string): string {
   const res = compileStyle({
index affe1f5a368418f0018bb88ffa13bc90e5fb3226..a55e2e6b2885b04edb749ac8f0b072c3a14f3217 100644 (file)
@@ -1,5 +1,5 @@
 import { parse } from '../src'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 import { baseParse, baseCompile } from '@vue/compiler-core'
 
 describe('compiler:sfc', () => {
index 0ab644af7f164d2d32457176b9e6b79585596046..5ab4641e98878e153117be16775c1df76e017a38 100644 (file)
@@ -6,7 +6,7 @@ import {
   ref,
   WritableComputedRef
 } from '../src'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('reactivity/computed', () => {
   mockWarn()
index 2d134922d3a700c132600b054df61d608b6826f5..62913e67063d29fe847bfb7b5f66aaa0570bca4c 100644 (file)
@@ -1,6 +1,6 @@
 import { ref, isRef } from '../src/ref'
 import { reactive, isReactive, toRaw, markNonReactive } from '../src/reactive'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 import { computed } from '../src/computed'
 
 describe('reactivity/reactive', () => {
index bcd1c43ec7fb94ec727e49e72153b346acede7e8..e009022d08c6b0f69c606d4b1df0213594219642 100644 (file)
@@ -12,7 +12,7 @@ import {
   ref,
   shallowReadonly
 } from '../src'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 /**
  * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
index 7ade99e9e94d0751377fd060777c6b6e95670528..6fb8239b8f9c6befe67560a21f4bc7b3f5d8ffa7 100644 (file)
@@ -3,7 +3,6 @@ import {
   h,
   nodeOps,
   serializeInner,
-  mockWarn,
   provide,
   inject,
   resolveComponent,
@@ -13,6 +12,7 @@ import {
   ref,
   getCurrentInstance
 } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('api: createApp', () => {
   mockWarn()
index 26359fe4c1ac10dfb8d03ae79a8edf81fa2fdaf2..d979861a82b699781b8ea8ca7b076d512dd450e8 100644 (file)
@@ -9,7 +9,8 @@ import {
   readonly,
   reactive
 } from '../src/index'
-import { render, nodeOps, serialize, mockWarn } from '@vue/runtime-test'
+import { render, nodeOps, serialize } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 // reference: https://vue-composition-api-rfc.netlify.com/api.html#provide-inject
 
index 8a0199e3ffb33c3cafeaf9fad66ac0784234aaaa..7d915eb0ff214a5fda666037db7f523ed3f479ee 100644 (file)
@@ -8,9 +8,9 @@ import {
   nextTick,
   renderToString,
   ref,
-  defineComponent,
-  mockWarn
+  defineComponent
 } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('api: options', () => {
   test('data', async () => {
index 15a0765f97e97e8540c9bb1a40c4424628d627fd..ad8f4787145db4eb6c95dfc7a4bc910fb8d9c22d 100644 (file)
@@ -1,11 +1,12 @@
 import { watch, reactive, computed, nextTick, ref, h } from '../src/index'
-import { render, nodeOps, serializeInner, mockWarn } from '@vue/runtime-test'
+import { render, nodeOps, serializeInner } from '@vue/runtime-test'
 import {
   ITERATE_KEY,
   DebuggerEvent,
   TrackOpTypes,
   TriggerOpTypes
 } from '@vue/reactivity'
+import { mockWarn } from '@vue/shared'
 
 // reference: https://vue-composition-api-rfc.netlify.com/api.html#watch
 
index 2014cd2f8e50489d6b5209adea25a6b21d510a44..ddfd8cab0bf8ed507510aea1e8f93d4617317bec 100644 (file)
@@ -1,9 +1,5 @@
-import {
-  createApp,
-  getCurrentInstance,
-  nodeOps,
-  mockWarn
-} from '@vue/runtime-test'
+import { createApp, getCurrentInstance, nodeOps } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 import { ComponentInternalInstance } from '../src/component'
 
 describe('component: proxy', () => {
index be809d5ff9835d59299cdeac99ab57082ddeb902..d9f753f93304196f25882be6db426de01b27c998 100644 (file)
@@ -7,10 +7,10 @@ import {
   watch,
   ref,
   nextTick,
-  mockWarn,
   defineComponent
 } from '@vue/runtime-test'
 import { setErrorRecovery } from '../src/errorHandling'
+import { mockWarn } from '@vue/shared'
 
 describe('error handling', () => {
   mockWarn()
index cfa4a3e23d1c81748c3c0bbcb0f44a09124b4c3a..392311c1cb5f93fb0fc9e00c2be69ef66c37377c 100644 (file)
@@ -1,5 +1,4 @@
 import {
-  mockWarn,
   createApp,
   nodeOps,
   resolveComponent,
@@ -9,6 +8,7 @@ import {
   resolveDynamicComponent,
   getCurrentInstance
 } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('resolveAssets', () => {
   test('should work', () => {
index e07cf141699d8fb3f3c65f8310b6ba51c8c48a23..000f900495202b7211b2ebbeba5da04f70e4b357 100644 (file)
@@ -1,5 +1,5 @@
 import { toHandlers } from '../../src/helpers/toHandlers'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('toHandlers', () => {
   mockWarn()
index fed38fc3f3a7fa9e2166f44b23e3926e7b3632e4..fe34eee601084f602c7e7af67395d21127515fb3 100644 (file)
@@ -8,7 +8,7 @@ import {
   onUpdated,
   defineComponent
 } from '@vue/runtime-dom'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('attribute fallthrough', () => {
   mockWarn()
index 553d73b5e75d2290d5e36698213d0816dcb93591..93ef3b99b73d58e287b9dd5b81cd37cff45f866f 100644 (file)
@@ -6,9 +6,9 @@ import {
   NodeTypes,
   TestElement,
   serialize,
-  serializeInner,
-  mockWarn
+  serializeInner
 } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 mockWarn()
 
index ec7cbb21eea810d48ebf6e704a87cbaee2cfc84d..be18d4a00a2e40107dab0a431e5e712656bb6431 100644 (file)
@@ -12,9 +12,9 @@ import {
   NodeOpTypes,
   nextTick,
   serialize,
-  triggerEvent,
-  mockWarn
+  triggerEvent
 } from '../src'
+import { mockWarn } from '@vue/shared'
 
 describe('test renderer', () => {
   mockWarn()
index 96c3ad1eb3e8dca414cf774935703d67d40f296c..c057da7e018192e5ff705c1cf02055a1b24beca0 100644 (file)
@@ -26,5 +26,4 @@ export function renderToString(vnode: VNode) {
 export * from './triggerEvent'
 export * from './serialize'
 export * from './nodeOps'
-export * from './utils/mockWarn'
 export * from '@vue/runtime-core'
index de6596198e75d3e1fbdee0d1f8ff4c247e9c3423..4d6f700166f0727e4bf375d7fee26973c2b2a65f 100644 (file)
@@ -5,6 +5,7 @@ export * from './patchFlags'
 export * from './globalsWhitelist'
 export * from './codeframe'
 export * from './domTagConfig'
+export * from './mockWarn'
 
 export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
   ? Object.freeze({})
index 7b732528bd529dd3175637b42d78dd19d4638584..4a7a06bb64d1454e0f5c51899d362f21e05fc940 100644 (file)
@@ -1,5 +1,5 @@
 import { createApp } from '../src'
-import { mockWarn } from '@vue/runtime-test'
+import { mockWarn } from '@vue/shared'
 
 describe('compiler + runtime integration', () => {
   mockWarn()