Skip to content

Commit a434a37

Browse files
committed
notification tests
1 parent 99de9d5 commit a434a37

File tree

3 files changed

+468
-10
lines changed

3 files changed

+468
-10
lines changed

packages/unpublished-test-infra/src/test-support/asserts/assert-notification.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ export function configureNotificationsAssert(this: TestContext, assert: Assert)
9797
identifier: StableRecordIdentifier | StableDocumentIdentifier,
9898
bucket: NotificationType | DocumentCacheOperation,
9999
key: string | null,
100-
count: number
100+
count: number,
101+
message?: string
101102
) {
102103
const counter = getCounter(context, identifier, bucket, key);
103104

104105
this.pushResult({
105106
result: counter.count === count,
106107
actual: counter.count,
107108
expected: count,
108-
message: `Expected ${count} ${bucket} notifications for ${identifier.lid} ${key || ''}, got ${counter.count}`,
109+
message: `${message ? message + ' | ' : ''}Expected ${count} ${bucket} notifications for ${identifier.lid} ${key || ''}, got ${counter.count}`,
109110
});
110111

111112
counter.count = 0;

packages/unpublished-test-infra/src/test-support/asserts/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ declare module '@warp-drive/diagnostic' {
4848
identifier: StableDocumentIdentifier | StableRecordIdentifier,
4949
bucket: NotificationType | CacheOperation,
5050
key: string | null,
51-
count: number
51+
count: number,
52+
message?: string
5253
): void;
5354

5455
clearNotifications(): void;

0 commit comments

Comments
 (0)