Skip to content

Commit 04c9733

Browse files
authored
Refactor: use native fetch (#132)
1 parent a816d76 commit 04c9733

File tree

4 files changed

+570
-597
lines changed

4 files changed

+570
-597
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"repository": "[email protected]:safe-global/safe-gateway-typescript-sdk.git",
1010
"author": "katspaugh",
1111
"license": "MIT",
12-
"dependencies": {
13-
"cross-fetch": "^3.1.5"
12+
"engines": {
13+
"node": ">=16"
1414
},
1515
"devDependencies": {
1616
"@types/jest": "^29.2.1",

src/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import fetch from 'cross-fetch'
2-
31
export type Params = Record<string, string | number | boolean | null>
42

53
export type ErrorResponse = {

tests/utils.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import fetch from 'cross-fetch'
21
import { fetchData, insertParams, stringifyQuery } from '../src/utils'
32

4-
jest.mock('cross-fetch')
5-
6-
const fetchMock = fetch as typeof fetch & jest.Mock
3+
const fetchMock = jest.spyOn(global, 'fetch') as typeof fetch & jest.Mock
74

85
describe('utils', () => {
96
describe('insertParams', () => {

0 commit comments

Comments
 (0)