如何使用ginkgo在多个测试文件中编写测试用例?
a_suite_test.go文件:
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))
})
})
})我运行了ginkgo,但是抛出了错误:
Failed to compile A:
go build xxx: no non-test Go files in xxx是否可以在其他测试文件中编写测试用例,而不是在套件测试文件中编写?
发布于 2018-02-28 20:48:16
跑
go test ./...从您的项目根目录,它将运行您的所有测试。对于ginkgo,你需要这个套件文件,但是go test命令会抓取它并运行它。
https://stackoverflow.com/questions/49024373
复制相似问题