fix(test): restore shared Bun mocks after suite cleanup

Prevent src/shared batch runs from leaking module mocks into later files, which was breaking Linux CI cache metadata and legacy plugin warning assertions.
This commit is contained in:
YeonGyu-Kim
2026-03-27 00:08:20 +09:00
parent 3e13a4cf57
commit 9daaeedc50
2 changed files with 10 additions and 2 deletions
@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, it, mock } from "bun:test"
import { afterAll, beforeEach, describe, expect, it, mock } from "bun:test"
import type { LegacyPluginCheckResult } from "./legacy-plugin-warning"
function createLegacyPluginCheckResult(
@@ -24,6 +24,10 @@ mock.module("./logger", () => ({
log: mockLog,
}))
afterAll(() => {
mock.restore()
})
async function importFreshStartupWarningModule(): Promise<typeof import("./log-legacy-plugin-startup-warning")> {
return import(`./log-legacy-plugin-startup-warning?test=${Date.now()}-${Math.random()}`)
}