up-bank-api icon indicating copy to clipboard operation
up-bank-api copied to clipboard

chore: Add tests

Open ndench opened this issue 3 years ago • 0 comments

Had a thought this arvo that if we mock out the UpClient, we can do some simple tests to ensure we're calling the correct endpoint and passing parameters though.

I'm not sure that this provides much value, so I also tried mocking out axios (you can see this in the commit history). But this made the tests harder to write and understand and it felt a lot like duplicating the implementation.

As it stands, they are still duplicating implementation a bit though.

I'm curious what you think @kvithana? I want to have some sanity around not accidentally breaking things, but not if it means we're just writing the same code twice. I think this strikes a pretty good balance between duplication but being quite quite and easy to write.

The tests are also a bit slow to run, I'm not sure why though. Would love some help tracking that down.

ndench avatar Oct 24 '20 09:10 ndench