goconvey icon indicating copy to clipboard operation
goconvey copied to clipboard

go test pass but browser test fails

Open yashasolutions opened this issue 2 years ago • 0 comments

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?

yashasolutions avatar May 23 '22 00:05 yashasolutions