Skip to content

Commit

Permalink
fix: use cross-fetch only for jest
Browse files Browse the repository at this point in the history
  • Loading branch information
avimak committed Jun 20, 2022
1 parent 94b2fff commit 83be37a
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 9 deletions.
3 changes: 3 additions & 0 deletions __tests__/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable no-console */
import fetch from 'cross-fetch';
import { register } from 'fetch-intercept';

global.fetch = fetch;

jest.setTimeout(50 * 60 * 1000);

if (process.env.DEBUG === 'true') {
Expand Down
153 changes: 146 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@
"@types/minimalistic-assert": "^1.0.1",
"@types/pako": "^2.0.0",
"@types/url-join": "^4.0.1",
"@types/whatwg-fetch": "^0.0.33",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"cross-fetch": "^3.1.5",
"eslint": "^8.17.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"fetch-intercept": "^2.4.0",
"husky": "^8.0.1",
"import-sort-style-module": "^6.0.0",
"jest": "^28.1.1",
Expand All @@ -68,7 +71,6 @@
"cross-fetch": "^3.1.5",
"elliptic": "^6.5.4",
"ethereum-cryptography": "^1.0.3",
"fetch-intercept": "^2.4.0",
"hash.js": "^1.1.7",
"json-bigint": "^1.0.0",
"minimalistic-assert": "^1.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/provider/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fetch from 'cross-fetch';
import urljoin from 'url-join';

import { ONE, StarknetChainId, ZERO } from '../constants';
Expand Down

0 comments on commit 83be37a

Please sign in to comment.