googlemaps / googlemaps/js-jest-mocks

Implement mocks for google.maps.geometry

Open
#299 0 comments 3 reactions 1 assignee Claimed by @wangela View on GitHub
priority: p2 type: feature request
Dominant language
TypeScript
Stars
42
Forks
33
Avg merge
1m
Merged PRs (30d)
3

Description

```
describe('given xxx.service.tsx', () => {
beforeEach(() => {
initialize();
});
describe('when I xxx', () => {
it('should yyy', () => {
const xxxspy = jest.spyOn(google.maps.geometry.spherical, 'computeLength').mockReturnValue(1);

const distance = xxx.getDistance(params)
expect(distance).toEqual(yyy)

xxxspy.mockRestore();
});
});
});
```

![image](https://user-images.githubusercontent.com/80784116/182220220-7bb4bd13-122a-4c90-93a2-e17749489343.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.