From 74cfec94ef60bead8c0370f1fd6added46bcb261 Mon Sep 17 00:00:00 2001 From: freakzlike Date: Wed, 17 May 2023 09:24:39 +0200 Subject: [PATCH] chore(tests): Remove unnecessary mock of console.warn --- tests/emit.spec.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/emit.spec.ts b/tests/emit.spec.ts index b54499385..ffc4c6b4a 100644 --- a/tests/emit.spec.ts +++ b/tests/emit.spec.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { describe, expect, it } from 'vitest' import { defineComponent, FunctionalComponent, @@ -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() { @@ -269,7 +258,8 @@ describe('emitted', () => { const Comp = { setup(_: Record, { emit }: { emit: SetupContext['emit'] }) { emit('foo') - } + }, + template: '
' } const wrapper = mount(Comp) expect(wrapper.emitted().foo).toBeTruthy()