From a9b1719790722e5a3c4abff69e24afb715d56d74 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Fri, 16 Oct 2026 02:21:43 +0900 Subject: [PATCH] test(build): type the esbuild dispose mock for Vitest 5 --- src/utils/build.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/build.test.ts b/src/utils/build.test.ts index a0b0cf8..8801157 100644 --- a/src/utils/build.test.ts +++ b/src/utils/build.test.ts @@ -1,5 +1,6 @@ import type { context, PluginBuild } from 'esbuild' import { Hono } from 'hono' +import type { Mock } from 'vitest' import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' // Mock dependencies @@ -16,7 +17,7 @@ import { buildAndImportApp } from './build.js' describe('buildAndImportApp', () => { const getMockEsbuild = async () => vi.mocked((await import('esbuild')).context) - let mockEsbuildDispose: ReturnType + let mockEsbuildDispose: Mock<() => Promise> let mockEsbuild: Awaited> type OnEndCallback = Parameters[0] @@ -48,7 +49,7 @@ describe('buildAndImportApp', () => { } beforeEach(async () => { - mockEsbuildDispose = vi.fn() + mockEsbuildDispose = vi.fn(async () => {}) mockEsbuild = await getMockEsbuild() vi.clearAllMocks()