Skip to content

Conversation

matthieubosquet
Copy link
Collaborator

@matthieubosquet matthieubosquet commented Sep 29, 2023

@joachimvh this PR removes the node-fetch dependency because I believe node 18 fetch is enough (and node 16 is not supported anymore).

I'm planning to get that in and publish version 3.0.0 of the library with minimum node 18 support including @woutermont's contribution to expose caching.

What do you think?

Copy link
Member

@joachimvh joachimvh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally have no experience with the builtin fetch in node. There's also an issue in the authn library blocking me from updating the oidc-provider library in CSS, which is necessary when updating to node 18, but hoping to get that fixed before the next major release.

I did see some issues passing by about the fetch of which I don't know how big of an impact this could be. For example comunica/comunica#1252. So probably want to run some tests with CSS to see if there is an impact there.

Comment on lines +7 to +9
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
global.fetch = jest.fn();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to use jest.spyOn so you don't need to @ts-ignore. E.g., https://stackoverflow.com/questions/73597037/how-to-test-mock-a-fetch-api-in-a-react-component-using-jest .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants