-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set Bugsnag-Integrity header in delivery-fetch
- Loading branch information
Dan Skinner
committed
Oct 15, 2024
1 parent
50b432a
commit 14dca7e
Showing
5 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const { TextDecoder, TextEncoder } = require('node:util') | ||
const crypto = require('crypto') | ||
|
||
const JSDOMEnvironment = require('jest-environment-jsdom') | ||
|
||
class FixJSDOMEnvironment extends JSDOMEnvironment { | ||
constructor (...args) { | ||
super(...args) | ||
|
||
this.global.TextEncoder = TextEncoder | ||
this.global.TextDecoder = TextDecoder | ||
this.global.crypto = { | ||
subtle: crypto.webcrypto.subtle | ||
} | ||
} | ||
} | ||
|
||
module.exports = FixJSDOMEnvironment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters