vue3-core/packages/runtime-test
daiwei 8c1f61d050 chore: format 2025-09-15 10:18:59 +08:00
..
__tests__ chore(runtime-test): remove useless test code (#11483) 2024-08-05 10:42:13 +08:00
src chore(deps): upgrade to TypeScript 5.6 2024-09-10 16:46:19 +08:00
LICENSE chore: license 2019-10-28 11:15:17 -04:00
README.md chore: format 2025-09-15 10:18:59 +08:00
index.js refactor: rename packages 2018-10-26 15:44:50 -04:00
package.json chore: exclude private packages from version updates 2023-11-21 09:37:37 +08:00

README.md

@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)