Feat: Integration tests

This commit is contained in:
Daniel Hougaard
2024-04-16 17:29:31 +02:00
parent 12d5fb1043
commit bcb3eaab74
5 changed files with 334 additions and 0 deletions

26
cli/test/helper.go Normal file
View File

@@ -0,0 +1,26 @@
package tests
type Secret struct {
Key string
Value string
}
func Map[T, U any](ts []T, f func(T) U) []U {
us := make([]U, len(ts))
for i := range ts {
us[i] = f(ts[i])
}
return us
}
func getSecretKeysAndValues(secrets []Secret) (keys []string, values []string) {
secretKeys := []string{}
secretValues := []string{}
for _, secret := range secrets {
secretKeys = append(secretKeys, secret.Key)
secretValues = append(secretValues, secret.Value)
}
return secretKeys, secretValues
}