jx/cli_test.go
Matthew Rich f2e451e668
Some checks failed
Lint / golangci-lint (push) Failing after 10m2s
Declarative Tests / test (push) Failing after 41s
add cli test
2024-04-03 11:47:55 -07:00

21 lines
447 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package main
import (
"github.com/stretchr/testify/assert"
"os"
"os/exec"
"testing"
"errors"
)
func TestCli(t *testing.T) {
if _, e := os.Stat("./decl"); errors.Is(e, os.ErrNotExist) {
t.Skip("cli not built")
}
yaml, cliErr := exec.Command("./decl", "-import-resource", "file://decl").Output()
assert.Nil(t, cliErr)
assert.Greater(t, len(yaml), 0)
}