Skip to content

Commit 0782a10

Browse files
authored
chore(tests): Remove unnecessary mock of console.warn (#2056)
1 parent d56cce2 commit 0782a10

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/emit.spec.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
1+
import { describe, expect, it } from 'vitest'
22
import {
33
defineComponent,
44
FunctionalComponent,
@@ -13,17 +13,6 @@ import EmitsEventScriptSetup from './components/EmitsEventScriptSetup.vue'
1313
import { mount } from '../src'
1414

1515
describe('emitted', () => {
16-
let consoleWarnSave = console.info
17-
18-
beforeEach(() => {
19-
consoleWarnSave = console.warn
20-
console.warn = vi.fn()
21-
})
22-
23-
afterEach(() => {
24-
console.warn = consoleWarnSave
25-
})
26-
2716
it('captures events emitted via this.$emit', async () => {
2817
const Component = defineComponent({
2918
render() {
@@ -269,7 +258,8 @@ describe('emitted', () => {
269258
const Comp = {
270259
setup(_: Record<string, any>, { emit }: { emit: SetupContext['emit'] }) {
271260
emit('foo')
272-
}
261+
},
262+
template: '<div/>'
273263
}
274264
const wrapper = mount(Comp)
275265
expect(wrapper.emitted().foo).toBeTruthy()

0 commit comments

Comments
 (0)