fix(test): reset session manager storage in registry tests
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
const { describe, expect, test } = require("bun:test")
|
const { afterEach, describe, expect, test } = require("bun:test")
|
||||||
const { createToolExecuteBeforeHandler } = require("./tool-execute-before")
|
const { createToolExecuteBeforeHandler } = require("./tool-execute-before")
|
||||||
const { createToolRegistry } = require("./tool-registry")
|
const { createToolRegistry } = require("./tool-registry")
|
||||||
const { builtinTools } = require("../tools")
|
const { builtinTools } = require("../tools")
|
||||||
|
const { resetStorageClient } = require("../tools/session-manager/storage")
|
||||||
|
|
||||||
describe("createToolExecuteBeforeHandler", () => {
|
describe("createToolExecuteBeforeHandler", () => {
|
||||||
test("does not execute subagent question blocker hook for question tool", async () => {
|
test("does not execute subagent question blocker hook for question tool", async () => {
|
||||||
@@ -222,11 +223,19 @@ describe("createToolExecuteBeforeHandler", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe("createToolRegistry", () => {
|
describe("createToolRegistry", () => {
|
||||||
|
afterEach(() => {
|
||||||
|
resetStorageClient()
|
||||||
|
})
|
||||||
|
|
||||||
function createRegistryInput(overrides = {}) {
|
function createRegistryInput(overrides = {}) {
|
||||||
return {
|
return {
|
||||||
ctx: {
|
ctx: {
|
||||||
directory: process.cwd(),
|
directory: process.cwd(),
|
||||||
client: {},
|
client: {
|
||||||
|
session: {
|
||||||
|
messages: async () => ({ data: [] }),
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
pluginConfig: {
|
pluginConfig: {
|
||||||
...overrides,
|
...overrides,
|
||||||
|
|||||||
Reference in New Issue
Block a user