فهرست منبع

fix unexpected warnings in tests

Evan You 9 سال پیش
والد
کامیت
ae4db82c4b

+ 1 - 1
test/unit/features/component/component-keep-alive.spec.js

@@ -265,7 +265,7 @@ describe('Component keep-alive', () => {
             <keep-alive>
             <keep-alive>
               <component :is="view" class="test"></component>
               <component :is="view" class="test"></component>
             </keep-alive>
             </keep-alive>
-          <transition>
+          </transition>
         </div>`,
         </div>`,
         data: {
         data: {
           view: 'one'
           view: 'one'

+ 0 - 1
test/unit/features/component/component.spec.js

@@ -294,7 +294,6 @@ describe('Component', () => {
     expect(spy).not.toHaveBeenCalled()
     expect(spy).not.toHaveBeenCalled()
     vm.a = null
     vm.a = null
     waitForUpdate(() => {
     waitForUpdate(() => {
-      expect('Error when rendering root instance').toHaveBeenWarned()
       expect(spy).toHaveBeenCalled()
       expect(spy).toHaveBeenCalled()
       expect(vm.$el.textContent).toBe('123') // should preserve rendered DOM
       expect(vm.$el.textContent).toBe('123') // should preserve rendered DOM
       vm.a = { b: 234 }
       vm.a = { b: 234 }

+ 1 - 0
test/unit/features/options/data.spec.js

@@ -79,6 +79,7 @@ describe('Options data', () => {
   it('should have access to props', () => {
   it('should have access to props', () => {
     const Test = {
     const Test = {
       props: ['a'],
       props: ['a'],
+      render () {},
       data () {
       data () {
         return {
         return {
           b: this.a
           b: this.a

+ 3 - 0
test/unit/features/options/lifecycle.spec.js

@@ -45,6 +45,7 @@ describe('Options lifecyce hooks', () => {
   describe('beforeMount', () => {
   describe('beforeMount', () => {
     it('should not have mounted', () => {
     it('should not have mounted', () => {
       const vm = new Vue({
       const vm = new Vue({
+        render () {},
         beforeMount () {
         beforeMount () {
           spy()
           spy()
           expect(this._isMounted).toBe(false)
           expect(this._isMounted).toBe(false)
@@ -160,6 +161,7 @@ describe('Options lifecyce hooks', () => {
   describe('beforeDestroy', () => {
   describe('beforeDestroy', () => {
     it('should be called before destroy', () => {
     it('should be called before destroy', () => {
       const vm = new Vue({
       const vm = new Vue({
+        render () {},
         beforeDestroy () {
         beforeDestroy () {
           spy()
           spy()
           expect(this._isBeingDestroyed).toBe(false)
           expect(this._isBeingDestroyed).toBe(false)
@@ -177,6 +179,7 @@ describe('Options lifecyce hooks', () => {
   describe('destroyed', () => {
   describe('destroyed', () => {
     it('should be called after destroy', () => {
     it('should be called after destroy', () => {
       const vm = new Vue({
       const vm = new Vue({
+        render () {},
         destroyed () {
         destroyed () {
           spy()
           spy()
           expect(this._isBeingDestroyed).toBe(true)
           expect(this._isBeingDestroyed).toBe(true)

+ 2 - 2
test/unit/features/options/mixins.spec.js

@@ -17,7 +17,7 @@ describe('Options mixins', () => {
       methods: {
       methods: {
         b: function () {}
         b: function () {}
       }
       }
-    }).$mount()
+    })
 
 
     expect(vm.a).toBeDefined()
     expect(vm.a).toBeDefined()
     expect(vm.b).toBeDefined()
     expect(vm.b).toBeDefined()
@@ -103,7 +103,7 @@ describe('Options mixins', () => {
       methods: {
       methods: {
         b: function () {}
         b: function () {}
       }
       }
-    }).$mount()
+    })
 
 
     expect(vm.a).toBeDefined()
     expect(vm.a).toBeDefined()
     expect(vm.b).toBeDefined()
     expect(vm.b).toBeDefined()

+ 5 - 2
test/unit/features/options/parent.spec.js

@@ -2,10 +2,13 @@ import Vue from 'vue'
 
 
 describe('Options parent', () => {
 describe('Options parent', () => {
   it('should work', () => {
   it('should work', () => {
-    const parent = new Vue({}).$mount()
+    const parent = new Vue({
+      render () {}
+    }).$mount()
 
 
     const child = new Vue({
     const child = new Vue({
-      parent: parent
+      parent: parent,
+      render () {}
     }).$mount()
     }).$mount()
 
 
     // this option is straight-forward
     // this option is straight-forward

+ 2 - 1
test/unit/modules/vdom/create-component.spec.js

@@ -16,7 +16,8 @@ describe('create-component', () => {
   it('create a component basically', () => {
   it('create a component basically', () => {
     const child = {
     const child = {
       name: 'child',
       name: 'child',
-      props: ['msg']
+      props: ['msg'],
+      render () {}
     }
     }
     const init = jasmine.createSpy()
     const init = jasmine.createSpy()
     const data = {
     const data = {