test: fix temp tests

This commit is contained in:
Evan You 2019-08-23 15:32:19 -04:00
parent fd1fef5502
commit b70f8d267e
9 changed files with 27 additions and 42 deletions

View File

@ -1,3 +1,5 @@
// reference: https://vue-composition-api-rfc.netlify.com/api.html#provide-inject
describe('api: provide/inject', () => {})
describe('api: provide/inject', () => {
test.todo('should work')
})

View File

@ -1,3 +1,5 @@
// reference: https://vue-composition-api-rfc.netlify.com/api.html#lifecycle-hooks
describe('api: lifecycle hooks', () => {})
describe('api: lifecycle hooks', () => {
test.todo('should work')
})

View File

@ -1,3 +1,5 @@
// reference: https://vue-composition-api-rfc.netlify.com/api.html#setup
describe('api: setup context', () => {})
describe('api: setup context', () => {
test.todo('should work')
})

View File

@ -1,3 +1,5 @@
// reference: https://vue-composition-api-rfc.netlify.com/api.html#template-refs
describe('api: template refs', () => {})
describe('api: template refs', () => {
test.todo('should work')
})

View File

@ -1,3 +1,5 @@
// reference: https://vue-composition-api-rfc.netlify.com/api.html#watch
describe('api: watch', () => {})
describe('api: watch', () => {
test.todo('should work')
})

View File

@ -0,0 +1,3 @@
describe('vdom: h', () => {
test.todo('should work')
})

View File

@ -1 +1,3 @@
// TODO
describe('vdom: component', () => {
test.todo('should work')
})

View File

@ -1 +1,3 @@
// TODO
describe('vdom: optimized mode', () => {
test.todo('should work')
})

View File

@ -1,39 +1,7 @@
;(global as any).__COMPAT__ = true
import Vue from '../src/index'
// import Vue from '../src/index'
describe('2.x compat build', async () => {
test('should work', async () => {
const root = document.createElement('div')
document.body.appendChild(root)
const mounted = jest.fn()
const updated = jest.fn()
const instance = new Vue({
data() {
return { count: 0 }
},
methods: {
change() {
this.count++
}
},
render(h: any) {
return h('div', this.count)
},
mounted,
updated
}).$mount(root)
expect(instance.count).toBe(0)
expect(root.textContent).toBe('0')
expect(mounted).toHaveBeenCalled()
instance.change()
expect(instance.count).toBe(1)
await Vue.nextTick()
expect(root.textContent).toBe('1')
expect(updated).toHaveBeenCalled()
})
describe('2.x compat build', () => {
test.todo('should work')
})