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

Run tests against mock API #103

Open
muety opened this issue Mar 20, 2021 · 1 comment
Open

Run tests against mock API #103

muety opened this issue Mar 20, 2021 · 1 comment

Comments

@muety
Copy link
Contributor

muety commented Mar 20, 2021

While @jaebradley is the only contributor to this project, it's fine to run tests against the actual WakaTime API using his account and credentials. However, in the future, it might be beneficial to stub the endpoints to make tests more predictable. E.g. WakaTimeClient Integration Test › getUser › gets user details expects a specific user object and therefore will fail when run against a different WakaTime account. Also, it feels somewhat odd to run tests against the production web service.

I'm not too involved in the JavaScript ecosystem, so I don't have any concrete proposals on how to best realize this. In the Java world, tools like WireMock exist. Probably there are (maybe more lightweight) alternative for Node projects as well.

@jaebradley
Copy link
Owner

I agree - I've been lazy about setting up a better system that doesn't have values hard-coded to mine.

Also, it feels somewhat odd to run tests against the production web service.

I see the point, though this is kind've the "realest" way to test against a system I have no affiliation with nor have knowledge / access to changes that have been made internally that might affect the client's output.

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

2 participants