kiegroup / kiegroup/mock-github

Node 18 and @octokit/core v5.0.0 incompatability

Open
#77 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
65
Forks
9
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
`Moctokit` does not work with Node 18. All `.reply` responses return the same result to Octokit. Setting the `status` as `200` and `404` do not differ the mock response`

I believe this is due to [Node 18 using a new http client](https://nodejs.org/en/blog/announcements/v18-release-announce) named [undici](https://github.com/nodejs/undici) for `fetch` API support

Looking at the code for Moctokit it uses `nock`, which has [an open issue for undici support](https://github.com/nock/nock/issues/2183)

**To Reproduce**
Use `Moctokit` with Node 18 and `@octokit/core` `v5.0.0`

**Expected behavior**
Proper mock responses are returned.

**Additional context**
I don't actually expect this to be solved until Nock is updated but an incompatibility note in the `README` would be nice.

Contributor guide

Open the contributing guide

Research direction

Start by reading the README and the package's Node and @octokit/core support information. Document that Node 18 with @octokit/core v5.0.0 is incompatible because the current nock-based mocking does not provide distinct responses; done means the limitation and affected versions are clearly stated.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.