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(zone.js): patch global instead of Mocha object #45047

Closed
wants to merge 2 commits into from

Commits on Feb 11, 2022

  1. fix(zone.js): patch global instead of Mocha object

    Close angular#42834
    
    In the new version fo Mocha, all global test functions are from `global`
    object instead of `Mocha` object. Adn the current `zone.js` Mocha
    patch's logic looks like this.
    
    ```
    global.describe = Mocha.describe = function() {
      return originalMochaDescribe.apply(this, arguments);
    }
    ```
    
    and `originalMochaDescribe` is the unpathced Mocha implementation
    looks like this
    
    ```
    function describe() {
      return context.describe(...);
    }
    ```
    
    And the `context` will finally delegate to `global.describe()`,
    so the current `zone.js` patch causes infinite loop.
    
    This commit will not patch function of `Mocha` object any longer.
    JiaLiPassion committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    09103a9 View commit details
    Browse the repository at this point in the history
  2. test(zone.js): add integration test for zone.js Mocha patch

    Add integration test for `Mocha` patch from `zone.js` to verify the
    issue angular#42384 is fixed
    JiaLiPassion committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    9069560 View commit details
    Browse the repository at this point in the history