Skip to content

Commit

Permalink
fix(cosmosgen): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgooz committed Mar 17, 2022
1 parent 0c3d9a6 commit 01c138e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions integration/cosmosgen/cosmosgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import (

func TestCosmosGen(t *testing.T) {
var (
env = envtest.New(t)
path = env.Scaffold("blog")
env = envtest.New(t)
path = env.Scaffold("blog")
dirGenerated = filepath.Join(path, "vue/src/store/generated")
)

const (
withMsgModuleName = "withmsg"
withoutMsgModuleName = "withoutmsg"
Expand Down Expand Up @@ -91,6 +93,8 @@ func TestCosmosGen(t *testing.T) {
)),
))

require.NoError(t, os.RemoveAll(dirGenerated))

env.Must(env.Exec("generate vuex",
step.NewSteps(step.New(
step.Exec(
Expand All @@ -105,7 +109,6 @@ func TestCosmosGen(t *testing.T) {

var expectedCosmosModules = []string{
"cosmos.auth.v1beta1",
"cosmos.authz.v1beta1",
"cosmos.bank.v1beta1",
"cosmos.base.tendermint.v1beta1",
"cosmos.crisis.v1beta1",
Expand All @@ -128,7 +131,6 @@ func TestCosmosGen(t *testing.T) {
"test.blog.withoutmsg",
}

dirGenerated := filepath.Join(path, "vue/src/store/generated")
for _, chainModule := range expectedCustomModules {
_, statErr := os.Stat(filepath.Join(dirGenerated, "test/blog", chainModule))
require.False(t, os.IsNotExist(statErr), fmt.Sprintf("the %s vuex store should have be generated", chainModule))
Expand Down

0 comments on commit 01c138e

Please sign in to comment.