Skip to content

fix: use await in test #2640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/trigger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ describe('trigger', () => {
})

describe('errors', () => {
it('throws error if options contains a target value', () => {
it('throws error if options contains a target value', async () => {
const expectedErrorMessage =
'[vue-test-utils]: you cannot set the target value of an event. See the notes section of the docs for more details—https://vue-test-utils.vuejs.org/api/wrapper/trigger.html'

Expand All @@ -356,7 +356,7 @@ describe('trigger', () => {
const wrapper = mount(Component, {})

const fn = wrapper.trigger('click', { target: 'something' })
expect(fn).rejects.toThrowError(expectedErrorMessage)
await expect(fn).rejects.toThrowError(expectedErrorMessage)

expect(clickHandler).not.toHaveBeenCalled()
})
Expand Down