The framework.AddCleanupAction API was a workaround for Ginkgo v1 not invoking AfterEach callbacks after a test failure. Ginkgo v2 not only fixed that, but also added a DeferCleanup API which can be used to run some code if (and only if!) the corresponding setup code ran. In several cases that makes the test cleanup simpler.
2.6 KiB
2.6 KiB