Skip to content

Commit

Permalink
test: Add tests for KubernetesApi
Browse files Browse the repository at this point in the history
For each test, we spin up a Fastify server with the endpoint that we
expect to get called. If needed, the request body is checked, and the
response is returned similar to a real Kubernetes API server. We then
assert that the function under test behaved as expected.

There appears to be no way to perform these tests without a real HTTP
server since `@kubernetes/client-node` doesn't seem to let us mock their
HTTP client, but this may actually be a benefit, since we're dealing
with the production code and not some mocked object.
  • Loading branch information
meyfa committed Jul 17, 2024
1 parent edf4289 commit d1b30f9
Showing 1 changed file with 466 additions and 0 deletions.
Loading

0 comments on commit d1b30f9

Please sign in to comment.