2017-05-12 10:22:00 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
2017-06-01 16:41:07 +08:00
|
|
|
export default function testObjectOption (name) {
|
2017-07-12 15:50:09 +08:00
|
|
|
it('should warn non object value', () => {
|
2017-05-12 10:22:00 +08:00
|
|
|
const options = {}
|
|
|
|
|
options[name] = () => {}
|
|
|
|
|
new Vue(options)
|
|
|
|
|
expect(`component option "${name}" should be an object`).toHaveBeenWarned()
|
|
|
|
|
})
|
|
|
|
|
|
2017-07-12 15:50:09 +08:00
|
|
|
it('should not warn valid object value', () => {
|
2017-05-12 10:22:00 +08:00
|
|
|
const options = {}
|
|
|
|
|
options[name] = {}
|
|
|
|
|
new Vue(options)
|
|
|
|
|
expect(`component option "${name}" should be an object`).not.toHaveBeenWarned()
|
|
|
|
|
})
|
|
|
|
|
}
|