mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 13:22:14 +00:00
perf(slack): avoid module resets in outbound adapter test
This commit is contained in:
@@ -16,6 +16,7 @@ vi.mock("openclaw/plugin-sdk/plugin-runtime", () => ({
|
||||
}));
|
||||
|
||||
let slackOutbound: typeof import("./outbound-adapter.js").slackOutbound;
|
||||
({ slackOutbound } = await import("./outbound-adapter.js"));
|
||||
|
||||
describe("slackOutbound", () => {
|
||||
const cfg = {
|
||||
@@ -27,13 +28,11 @@ describe("slackOutbound", () => {
|
||||
},
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
beforeEach(() => {
|
||||
sendMessageSlackMock.mockReset();
|
||||
hasHooksMock.mockReset();
|
||||
runMessageSendingMock.mockReset();
|
||||
hasHooksMock.mockReturnValue(false);
|
||||
({ slackOutbound } = await import("./outbound-adapter.js"));
|
||||
});
|
||||
|
||||
it("sends payload media first, then finalizes with blocks", async () => {
|
||||
|
||||
5
test/fixtures/test-timings.channels.json
vendored
5
test/fixtures/test-timings.channels.json
vendored
@@ -75,6 +75,9 @@
|
||||
"extensions/slack/src/monitor/slash.test.ts": {
|
||||
"durationMs": 12500
|
||||
},
|
||||
"extensions/slack/src/outbound-adapter.test.ts": {
|
||||
"durationMs": 4630
|
||||
},
|
||||
"extensions/whatsapp/src/send.test.ts": {
|
||||
"durationMs": 2700
|
||||
},
|
||||
@@ -190,7 +193,7 @@
|
||||
"durationMs": 950
|
||||
},
|
||||
"extensions/slack/src/send.upload.test.ts": {
|
||||
"durationMs": 923
|
||||
"durationMs": 10010
|
||||
},
|
||||
"extensions/telegram/src/bot-native-commands.registry.test.ts": {
|
||||
"durationMs": 842
|
||||
|
||||
Reference in New Issue
Block a user