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

fix: only activate once, when on #1824

Merged
merged 4 commits into from Feb 10, 2020
Merged

Commits on Nov 30, 2019

  1. feature: only activate once, when on

    While debugging the Jest memory leak, I was surprised to find the Nock
    was "activating" twice when imported. This is because intercept.js
    was calling `activate()` directly _AND_ back was setting the mode, which
    calls `restore()` and `activate()`. There is no need for this double
    initialization. Think of the CPUs we could be saving.
    I also discovered that Nock "activates" even if the proc is started with
    the `NOCK_OFF` env var set, which means Nock is polluting the global
    scope even when callers have asked it not to.
    
    Since it felt like the `back.setMode()` call was hiding in its module,
    I've moved it to the entry index file and wrapped it in a `isOn` check.
    mastermatt committed Nov 30, 2019
    Copy the full SHA
    8261fbb View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Copy the full SHA
    6a03cb1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    4361506 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2020

  1. Copy the full SHA
    dace878 View commit details
    Browse the repository at this point in the history