misc.spec.ts 482 B

123456789101112131415161718
  1. import { h, isReactive, nodeOps, reactive, render } from '@vue/runtime-test'
  2. describe('misc', () => {
  3. test('component public instance should not be observable', () => {
  4. let instance: any
  5. const Comp = {
  6. render() {},
  7. mounted() {
  8. instance = this
  9. },
  10. }
  11. render(h(Comp), nodeOps.createElement('div'))
  12. expect(instance).toBeDefined()
  13. const r = reactive(instance)
  14. expect(r).toBe(instance)
  15. expect(isReactive(r)).toBe(false)
  16. })
  17. })