MCPcopy
hub / github.com/angular/angular / testPassive

Function testPassive

packages/zone.js/test/browser/browser.spec.ts:1716–1723  ·  view source on GitHub ↗
(eventName: string, expectedPassiveLog: string, options: any)

Source from the content-addressed store, hash-verified

1714 logs.push(e.defaultPrevented ? 'defaultPrevented' : 'default will run');
1715 };
1716 const testPassive = function (eventName: string, expectedPassiveLog: string, options: any) {
1717 (button as any).addEventListener(eventName, listener, options);
1718 const evt = document.createEvent('Event');
1719 evt.initEvent(eventName, false, true);
1720 button.dispatchEvent(evt);
1721 expect(logs).toEqual(['default will run', expectedPassiveLog]);
1722 (button as any).removeAllListeners(eventName);
1723 };
1724 beforeEach(() => {
1725 logs = [];
1726 (button as any).removeAllListeners();

Callers 1

browser.spec.tsFile · 0.85

Calls 4

initEventMethod · 0.80
addEventListenerMethod · 0.65
removeAllListenersMethod · 0.65
dispatchEventMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…