Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mocking to unit tests #173

Open
jessicamcinchak opened this issue Aug 12, 2022 · 0 comments
Open

Add mocking to unit tests #173

jessicamcinchak opened this issue Aug 12, 2022 · 0 comments

Comments

@jessicamcinchak
Copy link
Member

Because some of our web components require an OS API key as a property, it means that our unit test references the existing environment variable and would fail with an invalid key.

In order to avoid making live requests during testing and making the tests more resiliant for users without an API key, we should add mocks of the expected responses (at least for OS Places API, we'll still have to think about how we deal with OS Vector Tiles etc).

https://vitest.dev/guide/mocking.html
See #139 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant