-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmapbox-gl.js
More file actions
38 lines (38 loc) · 1.01 KB
/
mapbox-gl.js
File metadata and controls
38 lines (38 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Mock for mapbox-gl in Jest tests
module.exports = {
accessToken: '',
Map: jest.fn().mockImplementation(() => ({
on: jest.fn(),
remove: jest.fn(),
addControl: jest.fn(),
removeControl: jest.fn(),
setCenter: jest.fn(),
setZoom: jest.fn(),
flyTo: jest.fn(),
easeTo: jest.fn(),
jumpTo: jest.fn(),
resize: jest.fn(),
getCanvas: jest.fn(() => ({
style: {},
})),
getStyle: jest.fn(() => ({})),
setStyle: jest.fn(),
})),
Marker: jest.fn().mockImplementation(() => ({
setLngLat: jest.fn().mockReturnThis(),
addTo: jest.fn().mockReturnThis(),
remove: jest.fn(),
getLngLat: jest.fn(),
setPopup: jest.fn().mockReturnThis(),
})),
Popup: jest.fn().mockImplementation(() => ({
setLngLat: jest.fn().mockReturnThis(),
setHTML: jest.fn().mockReturnThis(),
addTo: jest.fn().mockReturnThis(),
remove: jest.fn(),
})),
NavigationControl: jest.fn(),
GeolocateControl: jest.fn(),
ScaleControl: jest.fn(),
FullscreenControl: jest.fn(),
};