From 7dd11a7cb373bcbc4f9fc76e70b22bcb2b3ba3cf Mon Sep 17 00:00:00 2001 From: 2nofa11 <47783146+2nofa11@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:48:51 +0900 Subject: [PATCH] test: #255 10_minimum_example/060_template_compiler (#258) * chapter's e2e tests ( 10_minimum_example/060_template_compiler) * chore:delete-comment --- .../060_template_compiler/tests/e2e.spec.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 book/impls/10_minimum_example/060_template_compiler/tests/e2e.spec.ts 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!!', + ) + }) +})