Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go test pass but browser test fails #661

Open
yashasolutions opened this issue May 23, 2022 · 0 comments
Open

go test pass but browser test fails #661

yashasolutions opened this issue May 23, 2022 · 0 comments

Comments

@yashasolutions
Copy link

Hi,

I am testing a very basic cobra root command,

package cmd

import (
	"github.com/spf13/cobra"
)

func NewRootCmd() *cobra.Command {
	return &cobra.Command{
		Use:   "mycommand",
		Short: "mycommand",
		Long:  "mycommand",
		Run: func(cmd *cobra.Command, args []string) {
			// Do Stuff Here
		},
	}
}
package cmd

import (
	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestRoot(t *testing.T) {
	Convey("Given the root command", t, func() {
		cmd := NewRootCmd()
		Convey("The command should return Nil", func() {
			So(cmd.Execute(), ShouldBeNil)
		})
	})
}

If I run go test it passes.

\>$ go test
.
1 total assertion

PASS
ok      myproject/cmd       0.002s

but in the browser I get:

screen-2022-05-23-02H47-12

Documentation does not state that terminal or browser should be different.

Did I miss something somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant