laconicd/cmd/laconic2d/cmd_test.go
Prathamesh Musale af2b71abf0
All checks were successful
Build / build (pull_request) Successful in 2m48s
Lint / Run golangci-lint (pull_request) Successful in 2m52s
E2E Tests / test-e2e (pull_request) Successful in 3m40s
Unit Tests / test-unit (pull_request) Successful in 1m14s
Integration Tests / test-integration (pull_request) Successful in 2m13s
Add cmd and utils unit tests and a CI workflow
2024-03-07 14:25:07 +05:30

29 lines
740 B
Go

package main_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client/flags"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"git.vdb.to/cerc-io/laconic2d/app"
"git.vdb.to/cerc-io/laconic2d/cmd/laconic2d/cmd"
)
func TestInitCmd(t *testing.T) {
rootCmd := cmd.NewRootCmd()
rootCmd.SetArgs([]string{
"init", // Test the init cmd
"localtestnet", // Moniker
fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists
fmt.Sprintf("--%s=%s", flags.FlagChainID, "laconic_9000-1"),
})
err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome)
require.NoError(t, err)
}