I do not understand why 'go' cannot find my Ginkgo test files
Here's how my structure looks:
events
├── button_not_shown_event.go
├── events_test
│ └── button_not_shown_event_test.go
And here how my button_not_shown_event_test.go
look like
package events_test
import (
"fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ButtonNotShownEvent", func() {
BeforeEach(func() {
Expect(false).To(BeTrue())
})
Context("ButtonNotShownEvent.GET()", func() {
It("should not return a JSONify string", func() {
Expect(true).To(BeFalse())
})
})
})
Notice I have specifically written a test so that it will fail.
But every time I run the Ginkgo test I get the following error
go test ./app/events/events_test/button_not_shown_event_test.go -v
testing: warning: no tests to run
PASS
ok command-line-arguments 1.027s
So clearly there is something I'm missing over here.
Any clue?
You have a few issues.
(t *testing.T)
.Additionally, after a lot of comments by several people. You likely need to read the Ginkgo docs, to be sure you are following their process properly to get your tests setup properly.