fix: add afterEach cleanup in session-state tests for parallel test isolation

This commit is contained in:
justsisyphus 2026-01-28 14:36:58 +09:00
parent c249763d7e
commit 5dc8d577a4

View File

@ -1,4 +1,4 @@
import { describe, test, expect, beforeEach } from "bun:test" import { describe, test, expect, beforeEach, afterEach } from "bun:test"
import { import {
setSessionAgent, setSessionAgent,
getSessionAgent, getSessionAgent,
@ -13,9 +13,11 @@ describe("claude-code-session-state", () => {
beforeEach(() => { beforeEach(() => {
// #given - clean state before each test // #given - clean state before each test
_resetForTesting() _resetForTesting()
clearSessionAgent("test-session-1") })
clearSessionAgent("test-session-2")
clearSessionAgent("test-prometheus-session") afterEach(() => {
// #then - cleanup after each test to prevent pollution
_resetForTesting()
}) })
describe("setSessionAgent", () => { describe("setSessionAgent", () => {