Skip to content

Commit

Permalink
test: #255 10_minimum_example/060_template_compiler (#258)
Browse files Browse the repository at this point in the history
* chapter's e2e tests ( 10_minimum_example/060_template_compiler)

* chore:delete-comment
  • Loading branch information
2nofa11 authored Feb 5, 2024
1 parent 5f895dd commit 7dd11a7
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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: `<b class="hello" style="color: red;">Hello World!!</b>`,
})
app.mount('#host')

expect(host.innerHTML).toBe(
'<b class="hello" style="color: red;">Hello World!!</b>',
)
})
})

0 comments on commit 7dd11a7

Please sign in to comment.