compile.spec.js 399 B

123456789101112131415
  1. import Vue from 'vue'
  2. describe('Global API: compile', () => {
  3. it('should compile render functions', () => {
  4. const res = Vue.compile('<div><span>{{ msg }}</span></div>')
  5. const vm = new Vue({
  6. data: {
  7. msg: 'hello'
  8. },
  9. render: res.render,
  10. staticRenderFns: res.staticRenderFns
  11. }).$mount()
  12. expect(vm.$el.innerHTML).toContain('<span>hello</span>')
  13. })
  14. })