Skip to content
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

🚧 Gregor's code review and refactor #2252

Open
wants to merge 93 commits into
base: main
Choose a base branch
from
Open

🚧 Gregor's code review and refactor #2252

wants to merge 93 commits into from

Commits on Dec 13, 2021

  1. Configuration menu
    Copy the full SHA
    267807d View commit details
    Browse the repository at this point in the history
  2. refactor: comment format

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    094091a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c986a22 View commit details
    Browse the repository at this point in the history
  4. refactor: comment formatting

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    94c8fd3 View commit details
    Browse the repository at this point in the history
  5. WIP

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    3d7d26d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ed8a352 View commit details
    Browse the repository at this point in the history
  7. WIP

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    64b4ddb View commit details
    Browse the repository at this point in the history
  8. First successful intercept

    ```js
    const got = require('got')
    
    const intercept = require('./modules/node-intercept')
    
    run()
    
    async function run() {
      const reset = intercept()
    
      console.log('Intercepted:')
      console.log(await got('https://example.com').text())
      // logs "Hello, world!"
    
      console.log('\n\nNot Intercepted:')
      reset()
      console.log(await got('https://example.com').text())
      // logs HTML from example.com
    }
    ```
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    568a061 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fcae3f6 View commit details
    Browse the repository at this point in the history
  10. add hello world example

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    768fbb3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e459734 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    de2ebad View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7b98be9 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    95e0cf4 View commit details
    Browse the repository at this point in the history
  15. test: remove .only

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    495b13d View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    8131b72 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    cd072e4 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    4abcba2 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    374db48 View commit details
    Browse the repository at this point in the history
  20. fix: thow error if nocks http.ClientRequest() override is called wi…

    …thout arguments. Check if response callback is set before using
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    688d961 View commit details
    Browse the repository at this point in the history
  21. Revert "test: make existing test more resilient without changing its …

    …logic"
    
    This reverts commit ec8fb81.
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    0c14fea View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    63764bf View commit details
    Browse the repository at this point in the history
  23. fix: emit "error"

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    b2a6827 View commit details
    Browse the repository at this point in the history
  24. fix: default host to localhost

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    8707d26 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    50499e1 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    f56b62a View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    92e1249 View commit details
    Browse the repository at this point in the history
  28. test: skipping tests checking that the original http.{get,request}

    …methods are called in case a request is not intercepted
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    7d0ee09 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    78acbb3 View commit details
    Browse the repository at this point in the history
  30. fix: use correct variable name

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    035e451 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    a0b939f View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    cab4132 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    dbb2af6 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    c42a9fb View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    c611d18 View commit details
    Browse the repository at this point in the history
  36. test: adapt error message when overwritten new http.ClientRequest()

    … is called without options
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    191204e View commit details
    Browse the repository at this point in the history
  37. test: adapt test for internal normalizeRequestOptions() method. We …

    …no longer use a `.proto` property
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    3662d9e View commit details
    Browse the repository at this point in the history
  38. test: adapt test for internal stringifyRequest() method. We no long…

    …er use a `.proto` property
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    a9fd400 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    108195c View commit details
    Browse the repository at this point in the history
  40. test: nock.removeInterceptor() no longer accepts proto option. Ex…

    …pects `protocol` instead
    
    BREAKING CHANGE: `nock.removeInterceptor()` no longer accepts `proto` option. The option is `protocol` now and must be set to either `http:` or `https:`.
    
    Before
    
    ```js
    nock.removeInterceptor({
      proto: "https",
      hostname: "example.test",
      path: "/somepath",
    });
    ```
    
    After
    
    ```js
    nock.removeInterceptor({
      protocol: "https:",
      hostname: "example.test",
      path: "/somepath",
    });
    ```
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    793ad1f View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    a6f13de View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    c340aa0 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    e32b498 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    cc5e3dc View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    3a5590c View commit details
    Browse the repository at this point in the history
  46. fix: isActive()

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    e1a0f3c View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    17ac6b1 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    51f7332 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    7b87e6f View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    8443aea View commit details
    Browse the repository at this point in the history
  51. test: should be safe to call in the middle of a request

    see breaking change about intercept logic location
    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    70fc395 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    0f912fb View commit details
    Browse the repository at this point in the history
  53. test: tests/test_socket.js

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    3ef1407 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    522fa27 View commit details
    Browse the repository at this point in the history
  55. test: tests/test_net_connect.js

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    b3f66e9 View commit details
    Browse the repository at this point in the history
  56. fix: avoid multiple error events

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    bd4eaab View commit details
    Browse the repository at this point in the history
  57. test: tests/test_back.js

    gr2m committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    fd926b8 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2021

  1. test: tests/test_back_filters.js

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    6c8d591 View commit details
    Browse the repository at this point in the history
  2. fix: recorder & protocol usage

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    437b431 View commit details
    Browse the repository at this point in the history
  3. test: tests/test_recorder.js

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    b1f68cc View commit details
    Browse the repository at this point in the history
  4. fix: recorder

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    4db4099 View commit details
    Browse the repository at this point in the history
  5. style: make eslint happy

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    fac8952 View commit details
    Browse the repository at this point in the history
  6. increase coverage

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    d8e6cca View commit details
    Browse the repository at this point in the history
  7. update intercept usage examples

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    f5f8ede View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d9b7a85 View commit details
    Browse the repository at this point in the history
  9. record & replay example

    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    4535a01 View commit details
    Browse the repository at this point in the history
  10. fix: when bypassing the intercept and sending the real request instea…

    …d, call `.write` and `.end` on next tick and emit custom `nock-data` and `nock-end` events to enable recording of the request body
    gr2m committed Dec 19, 2021
    Configuration menu
    Copy the full SHA
    0abe3bf View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    86c4a37 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2021

  1. Configuration menu
    Copy the full SHA
    6f3bbd6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    96d0c2a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7f77a9c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3a65e34 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    72fc5f3 View commit details
    Browse the repository at this point in the history
  6. test: records https correctly

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    6366906 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f9367db View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ea2c986 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8d4f57a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b04e6b6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    58d8754 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    f0b56fb View commit details
    Browse the repository at this point in the history
  13. all tests passing \o/

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    9355665 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    9cb849d View commit details
    Browse the repository at this point in the history
  15. style: eslint

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    1320fee View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    92dab98 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    81cb9e6 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    ae99575 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0c0df4c View commit details
    Browse the repository at this point in the history
  20. add more context to skipped test

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    866e2e0 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    3e3df37 View commit details
    Browse the repository at this point in the history
  22. actuaully skip TODO test

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    bf08676 View commit details
    Browse the repository at this point in the history
  23. delete notes

    gr2m committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    6834394 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2021

  1. minor refactorings

    gr2m committed Dec 28, 2021
    Configuration menu
    Copy the full SHA
    64fe949 View commit details
    Browse the repository at this point in the history
  2. fix jsdoc tags

    gr2m committed Dec 28, 2021
    Configuration menu
    Copy the full SHA
    ec44b74 View commit details
    Browse the repository at this point in the history