test-object-option.js 483 B

1234567891011121314151617
  1. import Vue from 'vue'
  2. export default function testObjectOption (name: string) {
  3. it('should warn non object', () => {
  4. const options = {}
  5. options[name] = () => {}
  6. new Vue(options)
  7. expect(`component option "${name}" should be an object`).toHaveBeenWarned()
  8. })
  9. it('don\'t warn when is an object', () => {
  10. const options = {}
  11. options[name] = {}
  12. new Vue(options)
  13. expect(`component option "${name}" should be an object`).not.toHaveBeenWarned()
  14. })
  15. }