Skip to content

Commit ae4db82

Browse files
committed
fix unexpected warnings in tests
1 parent 7b389bc commit ae4db82

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ describe('Component keep-alive', () => {
265265
<keep-alive>
266266
<component :is="view" class="test"></component>
267267
</keep-alive>
268-
<transition>
268+
</transition>
269269
</div>`,
270270
data: {
271271
view: 'one'

test/unit/features/component/component.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ describe('Component', () => {
294294
expect(spy).not.toHaveBeenCalled()
295295
vm.a = null
296296
waitForUpdate(() => {
297-
expect('Error when rendering root instance').toHaveBeenWarned()
298297
expect(spy).toHaveBeenCalled()
299298
expect(vm.$el.textContent).toBe('123') // should preserve rendered DOM
300299
vm.a = { b: 234 }

test/unit/features/options/data.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe('Options data', () => {
7979
it('should have access to props', () => {
8080
const Test = {
8181
props: ['a'],
82+
render () {},
8283
data () {
8384
return {
8485
b: this.a

test/unit/features/options/lifecycle.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('Options lifecyce hooks', () => {
4545
describe('beforeMount', () => {
4646
it('should not have mounted', () => {
4747
const vm = new Vue({
48+
render () {},
4849
beforeMount () {
4950
spy()
5051
expect(this._isMounted).toBe(false)
@@ -160,6 +161,7 @@ describe('Options lifecyce hooks', () => {
160161
describe('beforeDestroy', () => {
161162
it('should be called before destroy', () => {
162163
const vm = new Vue({
164+
render () {},
163165
beforeDestroy () {
164166
spy()
165167
expect(this._isBeingDestroyed).toBe(false)
@@ -177,6 +179,7 @@ describe('Options lifecyce hooks', () => {
177179
describe('destroyed', () => {
178180
it('should be called after destroy', () => {
179181
const vm = new Vue({
182+
render () {},
180183
destroyed () {
181184
spy()
182185
expect(this._isBeingDestroyed).toBe(true)

test/unit/features/options/mixins.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('Options mixins', () => {
1717
methods: {
1818
b: function () {}
1919
}
20-
}).$mount()
20+
})
2121

2222
expect(vm.a).toBeDefined()
2323
expect(vm.b).toBeDefined()
@@ -103,7 +103,7 @@ describe('Options mixins', () => {
103103
methods: {
104104
b: function () {}
105105
}
106-
}).$mount()
106+
})
107107

108108
expect(vm.a).toBeDefined()
109109
expect(vm.b).toBeDefined()

test/unit/features/options/parent.spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import Vue from 'vue'
22

33
describe('Options parent', () => {
44
it('should work', () => {
5-
const parent = new Vue({}).$mount()
5+
const parent = new Vue({
6+
render () {}
7+
}).$mount()
68

79
const child = new Vue({
8-
parent: parent
10+
parent: parent,
11+
render () {}
912
}).$mount()
1013

1114
// this option is straight-forward

test/unit/modules/vdom/create-component.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ describe('create-component', () => {
1616
it('create a component basically', () => {
1717
const child = {
1818
name: 'child',
19-
props: ['msg']
19+
props: ['msg'],
20+
render () {}
2021
}
2122
const init = jasmine.createSpy()
2223
const data = {

0 commit comments

Comments
 (0)