MCPcopy Index your code
hub / github.com/coder/coder / makePushEvent

Function makePushEvent

site/src/serviceWorker.test.ts:46–60  ·  view source on GitHub ↗
(payload: WebpushMessage)

Source from the content-addressed store, hash-verified

44// a JSON payload and exposes waitUntil so we can await the
45// handler's async work.
46function makePushEvent(payload: WebpushMessage) {
47 let waitUntilPromise: Promise<unknown> = Promise.resolve();
48 return {
49 data: {
50 json: () => payload,
51 },
52 waitUntil: (p: Promise<unknown>) => {
53 waitUntilPromise = p;
54 },
55 // Expose the promise so tests can await it.
56 get _waitUntilPromise() {
57 return waitUntilPromise;
58 },
59 };
60}
61
62const testPayload: WebpushMessage = {
63 title: "Test Notification",

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected