File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,10 @@ func Test(t GinkgoTestingT, config TestConfig) {
231231// GinkgoTest for use when the tests run. Therefore its content can
232232// still be modified in a BeforeEach. The sanity package itself treats
233233// it as read-only.
234+ //
235+ // Only tests defined with DescribeSanity after the last invocation with
236+ // GinkgoTest (if there has be one) will be added, i.e. each test only
237+ // gets added at most once.
234238func GinkgoTest (config * TestConfig ) * TestContext {
235239 sc := newTestContext (config )
236240 registerTestsInGinkgo (sc )
Original file line number Diff line number Diff line change @@ -53,4 +53,8 @@ func registerTestsInGinkgo(sc *TestContext) {
5353 })
5454 })
5555 }
56+ // Don't register tests more than once! More tests might
57+ // be added later in a different context, followed by
58+ // another registerTestsInGinkgo call.
59+ tests = nil
5660}
You can’t perform that action at this time.
0 commit comments