-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base: nock
(Part II)
#54
Closed
6 of 7 tasks
Labels
show
Preparation issue for a live show
Comments
gr2m
changed the title
DO NOT EDIT - Await parsing by GitHub Actions
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base: Nov 21, 2021
nock
Going live in 30 minutes at https://twitch.tv/gregorcodes |
I'm now live on https://twitch.tv/gregorcodes |
I'm taking a break, I'll be back in 20 min |
more like 30min, but I'm back |
done, for good now :) |
40 tasks
gr2m
changed the title
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base:
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base: Nov 22, 2021
nock
nock
- Part II
gr2m
changed the title
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base:
π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base: Nov 22, 2021
nock
- Part IInock
(Part II)
16 tasks
This was referenced Dec 9, 2021
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ππ» Refactoring a 10+ years old code base:
nock
π Sunday, November 21, 2021
π 12:00am Pacific Time
ποΈ no guests
π https://www.twitch.tv/gregorcodes
π·οΈ opensource
Subscribe to this issues to get a notification before the show begins and a summary after the show concludes.
Refactoring a 10+ years old code base:
nock
nock
is, to the best of my knowledge, the most widely used http mocking library for Node.js. It's first commit by Pedro is from September 2011. Around 6 years later, Pedro invited me as a maintainer, about a year after Pedro himself stopped maintainingnock
.I offered to take one the maintenance as we depended on
nock
for other projects I was maintaining, mostly @hoodiehq and @octokit. I, and increasingly we as a new maintainer team, were able to onboard more maintainers (RichardLitt, Paul, and Matt), and we were able to secure a sponsorship of $5,000 by Coinbase. Together, we were able to bringnock
to a more maintainable state (most notably: 100% test coverage) and started addressing open issues and pull requests again.But the
nock
code base is still a huge monolith of intertwined logic which is hard to understand and impossible to maintain with a few hours of time that people graciously donated from time to time.In order to make
nock
's code base easier to understand, to maintain, and to make it possible to distribute the maintainership across more people, we decided the code base needs to be split up into separate modules@nock/intercept
- overwrite Node's native APIs to hook into the request lifecycle.@nock/mock
- provides API to define HTTP mocks@nock/recorder
- APIs to record requests/responses and replay them from filesIn this series of helpdesk shows, I'll live code on the
nock
code base attempting to split it up into the above modules.Outline
In my first extended session working on
nock
(#53), I dove into the current code base and tried to understand it. In the 2nd part I focused on the intercept part. After the show I managed to make it actually work, with a hard-coded mock (notes).http.IncomingMessage
instance for an intercepted request.intercept
module. The goal is to make all existing tests pass using the new module.I expect the work about will take about 3 shows.
TODOs
Before the show
undefined
nock
(Part II)Β #54 (comment))When show begins
nock
(Part II)Β #54 (comment))After the show
Recordings
Shownotes
nock/nock#2247 (comment)
The text was updated successfully, but these errors were encountered: