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

Create test helpers and reset mocks before each test #885

Closed
wants to merge 2 commits into from
Closed

Create test helpers and reset mocks before each test #885

wants to merge 2 commits into from

Conversation

Smirl
Copy link

@Smirl Smirl commented May 2, 2023

Summary

Whilst working on adding region support for #883 I found I was making a lot of changes to existing tests.

To reduce the size of that upcoming PR I thought I should split out this smaller change to:

  • add test helpers for mock responses.
  • reset the mocked client before each test as this was causing flaky tests
  • have a consistent indent style of the .on() and .resolves() because why not

Notes

I currently just import the helpers.ts file in the test files. However, we could use jest helpers and create a tsconfig.test.json, etc. if we wanted to go that way. Seemed to big a change for a first contribution. See https://stackoverflow.com/a/52910794.

@Smirl
Copy link
Author

Smirl commented Jun 1, 2023

Hey @int128,

Quick PR here on tests, I have another PR after this for region support also if you are interested?

@Smirl Smirl closed this Apr 18, 2024
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

Successfully merging this pull request may close these issues.

1 participant