0

How to write test case in multiple test file using ginkgo?

a_suite_test.go file:

func TestA(t *testing.T) {
    RegisterFailHandler(Fail)
    RunSpecs(t, "A Suite")
}

a_test.go:

var _ = Describe("A", func() {
    Context("A", func() {
        It("A", func() {
            Expect(1).To(Equal(1))
        })
    })
})

I run ginkgo, but error is throwed:

Failed to compile A:

go build xxx: no non-test Go files in xxx

Can I write test case in other test files rather than writing in suite test file ?

nameless
  • 2,015
  • 2
  • 11
  • 10

1 Answers1

0

run

go test ./...

from root of your project, it will run all your tests. With ginkgo you need this suite file, but go test command will grab it and run it.

hi_my_name_is
  • 4,894
  • 3
  • 34
  • 50