package testlib import ( "os" "testing" "github.com/cucumber/godog" "github.com/cucumber/godog/colors" ) var opts = godog.Options{ Output: colors.Colored(os.Stdout), Format: "junit", // Format: "pretty", Randomize: -1, } func RunTests(t *testing.T, name string, initializer func(_ *godog.ScenarioContext)) { suite := godog.TestSuite{ Name: name, ScenarioInitializer: func(s *godog.ScenarioContext) { initializer(s) }, Options: &opts, } status := suite.Run() if status != 0 { t.Errorf("godog run failed, status code: %d", status) } }