MCPcopy
hub / github.com/angular/components / createMapSpy

Function createMapSpy

src/google-maps/testing/fake-google-map-utils.ts:52–76  ·  view source on GitHub ↗
(options: google.maps.MapOptions)

Source from the content-addressed store, hash-verified

50
51/** Creates a jasmine.SpyObj for a google.maps.Map. */
52export function createMapSpy(options: google.maps.MapOptions): jasmine.SpyObj<google.maps.Map> {
53 const mapSpy = jasmine.createSpyObj('google.maps.Map', [
54 'setOptions',
55 'setCenter',
56 'setZoom',
57 'setMap',
58 'addListener',
59 'fitBounds',
60 'panBy',
61 'panTo',
62 'panToBounds',
63 'getBounds',
64 'getCenter',
65 'getClickableIcons',
66 'getHeading',
67 'getMapTypeId',
68 'getProjection',
69 'getStreetView',
70 'getTilt',
71 'getZoom',
72 'setMapTypeId',
73 ]);
74 mapSpy.addListener.and.returnValue({remove: () => {}});
75 return mapSpy;
76}
77
78/** Creates a jasmine.Spy to watch for the constructor of a google.maps.Map. */
79export function createMapConstructorSpy(

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…