MCPcopy
hub / github.com/angular/angular / findProfilerCall

Function findProfilerCall

packages/core/test/acceptance/profiler_spec.ts:53–64  ·  view source on GitHub ↗
(condition: ProfilerEvent | ((args: any[]) => boolean))

Source from the content-addressed store, hash-verified

51 afterAll(() => setProfiler(null));
52
53 function findProfilerCall(condition: ProfilerEvent | ((args: any[]) => boolean)) {
54 let predicate: (args: any[]) => boolean = (_) => true;
55 if (typeof condition !== 'function') {
56 predicate = (args: any[]) => args[0] === condition;
57 } else {
58 predicate = condition;
59 }
60 return profilerSpy.calls
61 .all()
62 .map((call: any) => call.args)
63 .find(predicate);
64 }
65
66 describe('change detection hooks', () => {
67 it('should call the profiler for creation and change detection', () => {

Callers 1

profiler_spec.tsFile · 0.85

Calls 3

mapMethod · 0.80
findMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…