切换vitest-browser
This commit is contained in:
11
vitest-example/HelloWorld.test.ts
Normal file
11
vitest-example/HelloWorld.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { expect, test } from 'vitest'
|
||||
import { getByText } from '@testing-library/dom'
|
||||
import HelloWorld from './HelloWorld.js'
|
||||
|
||||
test('renders name', () => {
|
||||
const parent = HelloWorld({ name: 'Vitest' })
|
||||
document.body.appendChild(parent)
|
||||
|
||||
const element = getByText(parent, 'Hello Vitest!')
|
||||
expect(element).toBeInTheDocument()
|
||||
})
|
Reference in New Issue
Block a user