vue3-yuanma/packages/runtime-test
2021-03-30 20:05:45 -04:00
..
__tests__ test: move mockWarn into setup files 2020-07-27 22:58:51 -04:00
src workflow: setup eslint for prohibited syntax and globals 2020-06-10 16:54:23 -04:00
api-extractor.json refactor(types): mark internal API exports and exclude from d.ts 2020-04-30 17:04:35 -04:00
index.js refactor: rename packages 2018-10-26 15:44:50 -04:00
LICENSE chore: license 2019-10-28 11:15:17 -04:00
package.json release: v3.0.10 2021-03-30 20:05:45 -04:00
README.md build: adjust build formats 2020-04-19 18:43:21 -04:00

@vue/runtime-test

This is for Vue's own internal tests only - it ensures logic tested using this package is DOM-agnostic, and it runs faster than JSDOM.

It can also be used as a reference for implementing a custom renderer.

import { h, render, nodeOps, dumpOps } from '@vue/runtime-test'

const App = {
  data () {
    return {
      msg: 'Hello World!'
    }
  }
  render () {
    return h('div', this.msg)
  }
}

// root is of type `TestElement` as defined in src/nodeOps.ts
const root = nodeOps.createElement('div')
render(h(App), root)

const ops = dumpOps()
console.log(ops)