Skip to content
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
16 changes: 3 additions & 13 deletions tests/emit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { describe, expect, it } from 'vitest'
import {
defineComponent,
FunctionalComponent,
Expand All @@ -13,17 +13,6 @@ import EmitsEventScriptSetup from './components/EmitsEventScriptSetup.vue'
import { mount } from '../src'

describe('emitted', () => {
let consoleWarnSave = console.info

beforeEach(() => {
consoleWarnSave = console.warn
console.warn = vi.fn()
})

afterEach(() => {
console.warn = consoleWarnSave
})

it('captures events emitted via this.$emit', async () => {
const Component = defineComponent({
render() {
Expand Down Expand Up @@ -269,7 +258,8 @@ describe('emitted', () => {
const Comp = {
setup(_: Record<string, any>, { emit }: { emit: SetupContext['emit'] }) {
emit('foo')
}
},
template: '<div/>'
}
const wrapper = mount(Comp)
expect(wrapper.emitted().foo).toBeTruthy()
Expand Down