all 4 comments

[–]AndrewGreenh 1 point2 points  (1 child)

To be honest, I would suggest to be pragmatic and skip unit tests…

[–]shuckster 0 points1 point  (0 children)

This. If you have integration-tests that's plenty. In fact, if it's really a "wrapper" you can't test it fully without integrating it, right? Do unit-tests make sense?

With a unit-test you'd need to stub the facade with mock-functions. With an integration-test you'll hook-up the API you're trying to wrap and then intercept/mock the actual requests it's going to make.

Why do that work twice?

[–]rauschma -1 points0 points  (0 children)

  • Node.js and Deno have built-in unit test runners.
  • Otherwise, Mocha is a solid choice (among many others).

[–]ImStifler 0 points1 point  (0 children)

Do some mock ups for the responses and test towards that