Can you provide a custom shim/patch with zone.js?

85 Views Asked by At

The way that zone.js works is by shimming out all standard browser/node APIs. That's a neat idea and seems to work quite well. It occurs to me that if its possible to provide your own custom shims then you could use that as a very flexible mocking system for tests rather than having to do stuff like rely on Sinon's fakeTimers.

Is doing this currently possible with zone?

1

There are 1 best solutions below

4
On

Yes, you can, and Sinon'sfakeTimers are being patched in a PR of zone.js (not released yet), but of course, you can create your own patch with current zone.js API.