-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
ππ» Refactoring a 10+ years old code base: nock - Part III
π
Sunday, November 28, 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 III
I will continue my refactoring work from last week: #54 and the week before: #53
A version humble version of the intercept
module is ready and I changed nock
's code to use it. The very first integration test passed. This week, I'll try to get as many tests pass as possible, maybe move some tests into the new module where it makes sense.
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 last week during π
11/21 @ 12:00pm PT - Refactoring a 10+ years old code base:
nock
(Part II)Β #54 - Make all tests pass, start with these
-
tests/test_intercept.js
-
tests/test_intercept_parallel.js
-
tests/test_client_request.js
-
tests/test_request_overrider.js
-
tests/test_abort.js
-
tests/test_allow_unmocked.js
-
tests/test_allow_unmocked_https.js
-
tests/test_basic_auth.js
-
tests/test_body_match.js
-
tests/test_content_encoding.js
-
tests/test_default_reply_headers.js
-
tests/test_delay.js
-
tests/test_destroy.js
-
tests/test_dynamic_mock.js
-
tests/test_events.js
-
tests/test_gzip_request.js
-
tests/test_header_matching.js
-
tests/test_ipv6.js
-
tests/test_logging.js
-
tests/test_net_connect.js
-
tests/test_query.js
-
tests/test_query_complex.js
-
tests/test_redirects.js
-
tests/test_repeating.js
-
tests/test_reply_body.js
-
tests/test_reply_function_async.js
-
tests/test_reply_function_sync.js
-
tests/test_reply_headers.js
-
tests/test_reply_with_error.js
-
tests/test_reply_with_file.js
-
tests/test_socket.js
-
tests/test_stream.js
-
tests/test_url_encoding.js
-
- Refactor the intercept module, in particular the normalization of request options. I have the gut feeling we should just use the
URL
api 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/1465040583341355013)
- 30 minute announcement comment (π 11/28 @ 12:00pm PT - Refactoring a 10+ years old code base: nock (Part III)Β #55 (comment))
When show begins
- start of show tweet
(https://twitter.com/gr2m/status/1465048163421675528) - comment on issue
(π 11/28 @ 12:00pm PT - Refactoring a 10+ years old code base: nock (Part III)Β #55 (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/1218606526