Skip to content

Commit 252ffde

Browse files
committed
Scope the error-sink test mock and drop the unused log dependency
1 parent 708ca2d commit 252ffde

4 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎bun.lock‎

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/webhook-triggers/test/launch.test.ts‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
// past this function (or `createWebhookIngressRoutes` would reject an
66
// already-launched delivery, and a retried webhook client would then
77
// mint a duplicate run for the same event).
8-
import { describe, expect, mock, test } from "bun:test";
8+
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
99

1010
let reportErrorCalls: unknown[] = [];
11-
mock.module("@corbits/error-sink", () => ({
12-
reportError: (...args: unknown[]) => {
13-
reportErrorCalls.push(args);
14-
return "ref_test";
15-
},
16-
}));
1711

1812
const actualFoldedRuns = await import("@corbits/folded-runs");
1913

@@ -43,6 +37,20 @@ mock.module("@corbits/folded-runs", () => ({
4337
},
4438
}));
4539

40+
beforeEach(async () => {
41+
reportErrorCalls = [];
42+
await mock.module("@corbits/error-sink", () => ({
43+
reportError: (...args: unknown[]) => {
44+
reportErrorCalls.push(args);
45+
return "ref_test";
46+
},
47+
}));
48+
});
49+
50+
afterEach(() => {
51+
mock.restore();
52+
});
53+
4654
const { launchWebhookTrigger } = await import("../src/launch");
4755

4856
const DEFINITION_ROW = {

‎packages/workflow-deploy-source/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"dependencies": {
1717
"@corbits/error-sink": "workspace:*",
1818
"@intx/hub-sessions": "workspace:*",
19-
"@intx/log": "0.3.0",
2019
"@intx/types": "0.3.0",
2120
"arktype": "catalog:",
2221
"drizzle-orm": "catalog:",

‎packages/workflow-deploy-source/test/record-on-deploy.test.ts‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22
// successful deploy, forwards the underlying result untouched, and never
33
// lets a recording failure fail the deploy call itself -- no DB, no
44
// SessionService, both are hand-rolled minimal doubles.
5-
import { describe, expect, mock, test } from "bun:test";
5+
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
66
import type {
77
AdoptingWorkflowDeployer,
88
DeployWorkflowDefinitionResult,
99
SessionService,
1010
} from "@intx/hub-sessions";
1111

1212
let reportErrorCalls: unknown[] = [];
13-
mock.module("@corbits/error-sink", () => ({
14-
reportError: (...args: unknown[]) => {
15-
reportErrorCalls.push(args);
16-
return "ref_test";
17-
},
18-
}));
13+
beforeEach(async () => {
14+
reportErrorCalls = [];
15+
await mock.module("@corbits/error-sink", () => ({
16+
reportError: (...args: unknown[]) => {
17+
reportErrorCalls.push(args);
18+
return "ref_test";
19+
},
20+
}));
21+
});
22+
afterEach(() => {
23+
mock.restore();
24+
});
1925

2026
const { withDeploySourceRecording } = await import("../src/record-on-deploy");
2127
import type {

0 commit comments

Comments
 (0)