-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
ππ» Refactoring a 10+ years old code base: nock (Part VII)
π
Sunday, December 26, 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 (Part VII)
I will continue my refactoring work from the first 6 weeks: #59, #58, #55, #54, #53
We use the new module throughout nock's code base now. Unfortunately some tests are still failing, so that's what I hope to finish in this session.
If we get all existing tests to pass and reach 100% test coverage again, I'll move the internal intercept module to its own repository and publish it as its own npm module.
Outline
- Quick recap of what we accomplished so far
- Detour: https://github.com/gr2m/http-recorder - Node.js in-process http(s) recording in 100 LOC
- Make remaining tests pass
-
tests/test_recorder.js
-
tests/test_back_filters.js
-
tests/test_back.js
-
- Refactor the intercept module, in particular the normalization of request options. I have the gut feeling we should just use the
URL
api to parse a request string and make sure we set all the properties. Have another look at what the nativehttp.RequestClient
api is doing. - Refactor the
nock
codebase. Remove no longer used code and obsolete tests. - Create the
nock/intercept
repository and move the internal module there - Make sure the new repository is fully documented and has 100% test coverage
- Setup continuous releases for the new module
- install the new module as dependency of
nock
- Celebrate the win!
TODOs
Before the show
- 30 minute announcement tweet
(https://twitter.com/gr2m/status/1475187516277936131) - 30 minute announcement comment
(π 12/26 @ 12:00pm PT - Refactoring a 10+ years old code base: nock (Part VII)Β #60 (comment))
When show begins
- start of show tweet
(https://twitter.com/gr2m/status/1475194342516035588) - comment on issue
(π 12/26 @ 12:00pm PT - Refactoring a 10+ years old code base: nock (Part VII)Β #60 (comment)) - Set twitter profile url
(https://twitter.com/gr2m)
After the show
- Reset twitter profile after the show
- recording available tweet
Recording
https://www.twitch.tv/videos/1244301943