diff --git a/book/impls/10_minimum_example/060_template_compiler/tests/e2e.spec.ts b/book/impls/10_minimum_example/060_template_compiler/tests/e2e.spec.ts new file mode 100644 index 00000000..e33341cc --- /dev/null +++ b/book/impls/10_minimum_example/060_template_compiler/tests/e2e.spec.ts @@ -0,0 +1,25 @@ +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 World!!`, + }) + app.mount('#host') + + expect(host.innerHTML).toBe( + 'Hello World!!', + ) + }) +})