comments.spec.ts 426 B

12345678910111213141516171819
  1. import Vue from 'vue'
  2. describe('Comments', () => {
  3. it('comments should be kept', () => {
  4. const vm = new Vue({
  5. comments: true,
  6. data() {
  7. return {
  8. foo: 1
  9. }
  10. },
  11. template:
  12. '<div><span>node1</span><!--comment1-->{{foo}}<!--comment2--></div>'
  13. }).$mount()
  14. expect(vm.$el.innerHTML).toEqual(
  15. '<span>node1</span><!--comment1-->1<!--comment2-->'
  16. )
  17. })
  18. })