angular/packages/zone.js/lib/mocha
JiaLiPassion 8efbdb57c1 fix(zone.js): patch global instead of Mocha object (#45047)
Close #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.

PR Close #45047
2022-02-16 13:51:51 -08:00
..
mocha.ts fix(zone.js): patch global instead of Mocha object (#45047) 2022-02-16 13:51:51 -08:00