test-object-option.ts 495 B

1234567891011121314151617
  1. import Vue from 'vue'
  2. export default function testObjectOption(name) {
  3. it(`Options ${name}: should warn non object value`, () => {
  4. const options = {}
  5. options[name] = () => {}
  6. new Vue(options)
  7. expect(`Invalid value for option "${name}"`).toHaveBeenWarned()
  8. })
  9. it(`Options ${name}: should not warn valid object value`, () => {
  10. const options = {}
  11. options[name] = {}
  12. new Vue(options)
  13. expect(`Invalid value for option "${name}"`).not.toHaveBeenWarned()
  14. })
  15. }