Skip to content

Commit 96015de

Browse files
committed
Fix failing unit tests on Node 14 and 16
1 parent bc46a5e commit 96015de

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
"typescript": "^5.0.0",
7474
"readable-stream-node-to-web": "^1.0.1",
7575
"webpack": "^5.73.0",
76-
"webpack-cli": "^4.10.0"
76+
"webpack-cli": "^4.10.0",
77+
"web-streams-ponyfill": "^1.4.2"
7778
},
7879
"jest": {
7980
"transform": {

test/SparqlEndpointFetcher-test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const DF = new DataFactory();
99

1010
// tslint:disable:no-trailing-whitespace
1111

12+
if (!globalThis.ReadableStream) {
13+
globalThis.ReadableStream = require('web-streams-ponyfill').ReadableStream;
14+
}
15+
1216
describe('SparqlEndpointFetcher', () => {
1317

1418
describe('constructed without fetch callback', () => {

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3880,6 +3880,11 @@ watchpack@^2.3.1:
38803880
glob-to-regexp "^0.4.1"
38813881
graceful-fs "^4.1.2"
38823882

3883+
web-streams-ponyfill@^1.4.2:
3884+
version "1.4.2"
3885+
resolved "https://registry.yarnpkg.com/web-streams-ponyfill/-/web-streams-ponyfill-1.4.2.tgz#0ae863cc5f7493903679f16b08cbf14d432b62f4"
3886+
integrity sha512-LCHW+fE2UBJ2vjhqJujqmoxh1ytEDEr0dPO3CabMdMDJPKmsaxzS90V1Ar6LtNE5VHLqxR4YMEj1i4lzMAccIA==
3887+
38833888
webidl-conversions@^3.0.0:
38843889
version "3.0.1"
38853890
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"

0 commit comments

Comments
 (0)