diff --git a/book/impls/10_minimum_example/060_template_compiler2/tests/e2e.spec.ts b/book/impls/10_minimum_example/060_template_compiler2/tests/e2e.spec.ts new file mode 100644 index 00000000..381699b5 --- /dev/null +++ b/book/impls/10_minimum_example/060_template_compiler2/tests/e2e.spec.ts @@ -0,0 +1,57 @@ +import { afterEach, beforeEach, describe, expect, it } from 'vitest' + +import { createApp } from '../packages' + +let host: HTMLElement +const initHost = () => { + host = document.createElement('div') + host.setAttribute('id', 'host') + document.body.appendChild(host) +} +beforeEach(() => initHost()) +afterEach(() => host.remove()) + +describe('10_minimum_example/060_template_compiler', () => { + it('should render template option', () => { + const app = createApp({ + template: ` +
+

Hello, chibivue!

+ Vue.js Logo +

chibivue is the minimal Vue.js

+ + +
+ `, + }) + app.mount('#host') + + expect(host.innerHTML).toBe( + `
+

Hello, chibivue!

+ Vue.js Logo +

chibivue is the minimal Vue.js

+ + +
`, + ) + }) +})