Skip to content

Commit

Permalink
Fix codecov: cli: fix reset commands #8270
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Apr 14, 2022
1 parent 4f858e1 commit 4c856a3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cmd/ostracon/commands/reset_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
package commands

import (
"os"
"path/filepath"
"testing"

"github.com/spf13/viper"

"github.com/stretchr/testify/require"

cfg "github.com/line/ostracon/config"
"github.com/line/ostracon/privval"
)

func setupEnv(t *testing.T) {
rootDir := t.TempDir()
viper.SetEnvPrefix("OC")
require.NoError(t, viper.BindEnv("HOME"))
require.NoError(t, os.Setenv("OC_HOME", rootDir))
}

func TestResetAllCmd(t *testing.T) {
setupEnv(t)
err := ResetAllCmd.RunE(ResetAllCmd, nil)
require.NoError(t, err)
}

func TestResetStateCmd(t *testing.T) {
setupEnv(t)
err := ResetStateCmd.RunE(ResetStateCmd, nil)
require.NoError(t, err)
}

func TestResetPrivValidatorCmd(t *testing.T) {
setupEnv(t)
err := ResetPrivValidatorCmd.RunE(ResetPrivValidatorCmd, nil)
require.NoError(t, err)
}
func Test_ResetAll(t *testing.T) {
config := cfg.TestConfig()
dir := t.TempDir()
Expand Down

0 comments on commit 4c856a3

Please sign in to comment.