💁🏻 Refactoring a 10+ years old code base: nock (Part VI)
📅 Sunday, December 19, 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 VI)
I will continue my refactoring work from the first 4 weeks: #58, #55, #54, #53
I got most of the tests working, but there are still some left.
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
Make remaining tests pass
[x] tests/test_remove_interceptor.js
[x] tests/test_fake_timer.js
[x] tests/test_header_matching.js
[x] tests/test_nock_lifecycle.js
[x] tests/test_socket.js
[x] tests/test_net_connect.js
[x] tests/test_back.js
[x] tests/test_back_filters.js
[x] tests/test_recorder.js
[x] make recorder and nock back use the new intercept module
[ ] make tests pass again: tests/test_recorder.js, tests/test_back.js, tests/test_back_filters.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 native http.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
💁🏻 Refactoring a 10+ years old code base: nock (Part VI) 📅 Sunday, December 19, 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 VI)
I will continue my refactoring work from the first 4 weeks: #58, #55, #54, #53
I got most of the tests working, but there are still some left.
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
tests/test_remove_interceptor.js
tests/test_fake_timer.js
tests/test_header_matching.js
tests/test_nock_lifecycle.js
tests/test_socket.js
tests/test_net_connect.js
tests/test_back.js
tests/test_back_filters.js
tests/test_recorder.js
tests/test_recorder.js
,tests/test_back.js
,tests/test_back_filters.js
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.nock
codebase. Remove no longer used code and obsolete tests.nock/intercept
repository and move the internal module therenock
TODOs
Before the show
When show begins
After the show
Recording
https://www.twitch.tv/videos/1238035345
Shownotes
https://github.com/nock/nock/discussions/2247#discussioncomment-1844444)](https://github.com/nock/nock/discussions/2247#discussioncomment-1844444