mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
16 lines
411 B
TypeScript
16 lines
411 B
TypeScript
import { flushPromises, mount } from '@vue/test-utils'
|
|
import AsAsync from '../components/AsAsync.vue'
|
|
|
|
test('mount component', async () => {
|
|
expect(AsAsync).toBeTruthy()
|
|
|
|
const wrapper = mount(AsAsync)
|
|
|
|
await wrapper.find('button').trigger('click')
|
|
|
|
await flushPromises() // start loading, so vitest started loading
|
|
await vi.dynamicImportSettled()
|
|
|
|
expect(wrapper.html()).toContain('1 x 2 = 2')
|
|
})
|