fix(test): restore real executor module in auto-slash-command-leak afterAll
mock.module('./executor') in auto-slash-command-leak.test.ts was leaking
into executor-resolution.test.ts in the same CI batch run, causing
executeSlashCommand to return the mock's raw replacement instead of the
real resolution result.
Fix: re-register the real executor exports via mock.module() in afterAll
so subsequent test files in the batch get the real implementation.
This commit is contained in:
@@ -19,8 +19,12 @@ mock.module("./executor", () => ({
|
|||||||
executeSlashCommand: executeSlashCommandMock,
|
executeSlashCommand: executeSlashCommandMock,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(async () => {
|
||||||
mock.restore()
|
mock.restore()
|
||||||
|
// Restore the real executor module so subsequent test files in the same batch
|
||||||
|
// (e.g. executor-resolution.test.ts) don't get the mocked version
|
||||||
|
const realExecutor = await import("./executor")
|
||||||
|
mock.module("./executor", () => realExecutor)
|
||||||
})
|
})
|
||||||
|
|
||||||
const logMock = spyOn(shared, "log").mockImplementation(() => {})
|
const logMock = spyOn(shared, "log").mockImplementation(() => {})
|
||||||
|
|||||||
Reference in New Issue
Block a user