Skip to content

Commit

Permalink
test: make global.fetch writable in setup.ts
Browse files Browse the repository at this point in the history
In node.js 20.12, supertest (or its dependencies) makes global.fetch unwritable and the test fails.
This problem occurs only in the test code and should be handled in test/setup.ts.
  • Loading branch information
usualoma committed Apr 11, 2024
1 parent 30e3eb2 commit e2f4965
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Object.defineProperty(global, 'fetch', {
value: global.fetch,
writable: true,
})
Object.defineProperty(global, 'Response', {
value: global.Response,
writable: true,
Expand Down

0 comments on commit e2f4965

Please sign in to comment.