googlemaps / googlemaps/js-jest-mocks

Add a way to check what params was instance initialised with

Open
#223 5 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: feature request
Dominant language
TypeScript
Stars
42
Forks
33
Avg merge
1m
Merged PRs (30d)
3

Description

It would be good if we could check what params was each instance initialised with. Similar to `toHaveBeenCalledWith`

For example:
```
const createPolygon = () =>
new google.maps.Polygon({
strokeWidth: 1
});

it('constructed polygon', () => {
createPolygon();
const polygonMocks = mockInstances.get(Polygon);

expect(polygonMocks[0]).toHaveBeenCalledWith(expect.objectContaining({strokeWidth: 1}))
});
```

Probably not working example, but just to get the idea. After reading the code I believe there is no way of doing this at the moment?

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.