test: move mockWarn into setup files

This commit is contained in:
Evan You
2020-07-27 22:58:37 -04:00
parent d4527230e4
commit 5c74243211
35 changed files with 103 additions and 199 deletions

View File

@@ -1,10 +1,7 @@
import { reactive, effect, toRaw, isReactive } from '../../src'
import { mockWarn } from '@vue/shared'
describe('reactivity/collections', () => {
describe('Map', () => {
mockWarn()
test('instanceof', () => {
const original = new Map()
const observed = reactive(original)

View File

@@ -1,10 +1,7 @@
import { reactive, effect, isReactive, toRaw } from '../../src'
import { mockWarn } from '@vue/shared'
describe('reactivity/collections', () => {
describe('Set', () => {
mockWarn()
it('instanceof', () => {
const original = new Set()
const observed = reactive(original)

View File

@@ -7,11 +7,8 @@ import {
WritableComputedRef,
isReadonly
} from '../src'
import { mockWarn } from '@vue/shared'
describe('reactivity/computed', () => {
mockWarn()
it('should return updated value', () => {
const value = reactive<{ foo?: number }>({})
const cValue = computed(() => value.foo)

View File

@@ -1,11 +1,8 @@
import { ref, isRef } from '../src/ref'
import { reactive, isReactive, toRaw, markRaw } from '../src/reactive'
import { mockWarn } from '@vue/shared'
import { computed } from '../src/computed'
describe('reactivity/reactive', () => {
mockWarn()
test('Object', () => {
const original = { foo: 1 }
const observed = reactive(original)

View File

@@ -10,7 +10,6 @@ import {
shallowReadonly,
isProxy
} from '../src'
import { mockWarn } from '@vue/shared'
/**
* @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html
@@ -18,8 +17,6 @@ import { mockWarn } from '@vue/shared'
type Writable<T> = { -readonly [P in keyof T]: T[P] }
describe('reactivity/readonly', () => {
mockWarn()
describe('Object', () => {
it('should make nested values readonly', () => {
const original = { foo: 1, bar: { baz: 2 } }