fix: clear spy call history in completion-verbose-logging test
spyOn(console, 'log') accumulates calls across test files in bun:test. Add mockClear() after spy creation to prevent cross-file contamination when run in the same bun test batch as completion.test.ts.
This commit is contained in:
@@ -33,6 +33,7 @@ describe("checkCompletionConditions verbose waiting logs", () => {
|
|||||||
it("does not print busy waiting line when verbose is disabled", async () => {
|
it("does not print busy waiting line when verbose is disabled", async () => {
|
||||||
// given
|
// given
|
||||||
const consoleLogSpy = spyOn(console, "log").mockImplementation(() => {})
|
const consoleLogSpy = spyOn(console, "log").mockImplementation(() => {})
|
||||||
|
consoleLogSpy.mockClear()
|
||||||
const ctx = createMockContext({
|
const ctx = createMockContext({
|
||||||
childrenBySession: {
|
childrenBySession: {
|
||||||
"test-session": [{ id: "child-1" }],
|
"test-session": [{ id: "child-1" }],
|
||||||
@@ -54,6 +55,7 @@ describe("checkCompletionConditions verbose waiting logs", () => {
|
|||||||
it("prints busy waiting line when verbose is enabled", async () => {
|
it("prints busy waiting line when verbose is enabled", async () => {
|
||||||
// given
|
// given
|
||||||
const consoleLogSpy = spyOn(console, "log").mockImplementation(() => {})
|
const consoleLogSpy = spyOn(console, "log").mockImplementation(() => {})
|
||||||
|
consoleLogSpy.mockClear()
|
||||||
const ctx = createMockContext({
|
const ctx = createMockContext({
|
||||||
childrenBySession: {
|
childrenBySession: {
|
||||||
"test-session": [{ id: "child-1" }],
|
"test-session": [{ id: "child-1" }],
|
||||||
|
|||||||
Reference in New Issue
Block a user