cdk8s-core icon indicating copy to clipboard operation
cdk8s-core copied to clipboard

Unit testing utilities

Open eladb opened this issue 4 years ago • 10 comments

We would like to offer utilities for unit testing in the cdk8s.Testing class.

Here are some examples of useful assertions:

  1. Assert that a chart synthesizes a manifest with a specific API object of a specific kind and optionally: apiVersion, a subset of properties (or exact match)
  2. assert count of API objects from a certain kind
  3. Assert that a chart synthesizes a manifest that matches a snapshot stored in a file (would be nice to make it easy to update the snapshot by e.g. setting an env. variable).

These functions should be testing-framework agnostic (and naturally jsii-able) so they can be used in all languages. If people want to create wrappers/plugins for specific frameworks, it should be easy to wrap these utilities.

eladb avatar May 17 '20 08:05 eladb