Skip to content

Commit

Permalink
Add unit test that counts preflight tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumerose committed Sep 29, 2020
1 parent bf1f96f commit 4f17924
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/crc/preflight/preflight_test.go
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestCount(t *testing.T) {
func TestCountConfigurationOptions(t *testing.T) {
cfg := config.New(config.NewEmptyInMemoryStorage())
RegisterSettings(cfg)
assert.Len(t, cfg.AllConfigs(), map[string]int{
Expand All @@ -19,6 +19,20 @@ func TestCount(t *testing.T) {
}[runtime.GOOS])
}

func TestCountPreflights(t *testing.T) {
assert.Len(t, getPreflightChecks(false), map[string]int{
"darwin": 10,
"linux": 21,
"windows": 14,
}[runtime.GOOS])

assert.Len(t, getPreflightChecks(true), map[string]int{
"darwin": 16,
"linux": 21,
"windows": 16,
}[runtime.GOOS])
}

func TestCheckPreflight(t *testing.T) {
check, calls := sampleCheck(nil, nil)
cfg := config.New(config.NewEmptyInMemoryStorage())
Expand Down

0 comments on commit 4f17924

Please sign in to comment.