func TestDeregisterHealthCheck(t *testing.T) { health.Register(COMPONENT, healthy) health.Unregister(COMPONENT) assert.Len(t, health.Components(), 0) assert.NotContains(t, health.Components(), COMPONENT) all := health.RunChecks() assert.Len(t, all, 0) teardown() }
// testify.TestSuite could be used to get automatic teardown cleanup after tests func teardown() { // clear all components from health check set for _, c := range health.Components() { health.Unregister(c) } }