mukan-ignite/ignite/version/version_test.go
Mukan Erkin Törük 26b204bd04
Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
feat: fork Ignite CLI v29 as Mukan Ignite — remove cosmos-sdk restrictions
2026-05-11 03:31:37 +03:00

61 lines
1.5 KiB
Go

package version_test
import (
"testing"
"github.com/blang/semver/v4"
"github.com/stretchr/testify/require"
"github.com/ignite/cli/v29/ignite/pkg/cosmosver"
"github.com/ignite/cli/v29/ignite/version"
)
func TestAssertSupportedCosmosSDKVersion(t *testing.T) {
testCases := []struct {
name string
version cosmosver.Version
errMsg string
}{
{
"invalid",
cosmosver.Version{Version: "invalid"},
"Your chain has been scaffolded with an older version of Cosmos SDK: invalid",
},
{
"too old",
cosmosver.Version{Version: "v0.45.0", Semantic: semver.MustParse("0.45.0")},
"Your chain has been scaffolded with an older version of Cosmos SDK: v0.45.0",
},
{
"v0.47.3",
cosmosver.Version{Version: "v0.47.3", Semantic: semver.MustParse("0.47.3")},
"Your chain has been scaffolded with an older version of Cosmos SDK: v0.47.3",
},
{
"v0.50",
cosmosver.Version{Version: "v0.50.1", Semantic: semver.MustParse("0.50.1")},
"",
},
{
"v0.50 fork",
cosmosver.Version{Version: "v0.50.1-rollkit-v0.11.6-no-fraud-proofs", Semantic: semver.MustParse("0.50.1-rollkit-v0.11.6-no-fraud-proofs")},
"",
},
{
"v0.53",
cosmosver.Version{Version: "v0.53.0", Semantic: semver.MustParse("0.53.0")},
"",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := version.AssertSupportedCosmosSDKVersion(tc.version)
if tc.errMsg == "" {
require.NoError(t, err)
} else {
require.ErrorContains(t, err, tc.errMsg)
}
})
}
}