Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit b5c58ef

Browse files
committed
Ignore isTrusted in {Fetch,Scheduled}Event tests
`isTrusted` is no longer returned from `getObjectProperties()` as of Node 20
1 parent 4f7bc5b commit b5c58ef

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

packages/core/test/standards/event.spec.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -483,13 +483,11 @@ test("FetchEvent: hides implementation details", (t) => {
483483
const event = new FetchEvent("fetch", {
484484
request: new Request("http://localhost:8787"),
485485
});
486-
t.deepEqual(getObjectProperties(event), [
487-
"isTrusted",
488-
"passThroughOnException",
489-
"request",
490-
"respondWith",
491-
"waitUntil",
492-
]);
486+
t.deepEqual(
487+
// `isTrusted` no longer included as of Node 20
488+
getObjectProperties(event).filter((name) => name !== "isTrusted"),
489+
["passThroughOnException", "request", "respondWith", "waitUntil"]
490+
);
493491
});
494492
test("FetchEvent: methods throw if this is incorrectly bound", (t) => {
495493
const { respondWith, passThroughOnException, waitUntil } = new FetchEvent(
@@ -505,12 +503,11 @@ test("ScheduledEvent: hides implementation details", (t) => {
505503
scheduledTime: 1000,
506504
cron: "30 * * * *",
507505
});
508-
t.deepEqual(getObjectProperties(event), [
509-
"cron",
510-
"isTrusted",
511-
"scheduledTime",
512-
"waitUntil",
513-
]);
506+
t.deepEqual(
507+
// `isTrusted` no longer included as of Node 20
508+
getObjectProperties(event).filter((name) => name !== "isTrusted"),
509+
["cron", "scheduledTime", "waitUntil"]
510+
);
514511
});
515512
test("ScheduledEvent: methods throw if this is incorrectly bound", (t) => {
516513
const { waitUntil } = new ScheduledEvent("scheduled", {

0 commit comments

Comments
 (0)