...
1 package fail_fixture_test
2
3 import (
4 "context"
5 "time"
6
7 . "github.com/onsi/ginkgo/v2"
8 . "github.com/onsi/gomega"
9 )
10
11 var _ = It("handles top level failures", func() {
12 Ω("a top level failure on line 12").Should(Equal("nope"))
13 println("NEVER SEE THIS")
14 })
15
16 var _ = Describe("Exercising different failure modes", func() {
17 It("synchronous failures", func() {
18 Ω("a sync failure").Should(Equal("nope"))
19 println("NEVER SEE THIS")
20 })
21
22 It("synchronous panics", func() {
23 panic("a sync panic")
24 println("NEVER SEE THIS")
25 })
26
27 It("synchronous failures with FAIL", func() {
28 Fail("a sync FAIL failure")
29 println("NEVER SEE THIS")
30 })
31
32 It("times out", func(c context.Context) {
33 <-c.Done()
34 }, NodeTimeout(time.Millisecond*50))
35 })
36
37 var _ = Specify("a top level specify", func() {
38 Fail("fail the test")
39 })
40
41 var _ = DescribeTable("a top level DescribeTable",
42 func(x, y int) {
43 Expect(x).To(Equal(y))
44 },
45 Entry("a TableEntry constructed by Entry", 2, 3),
46 )
47
48 var helper = func() {
49 GinkgoHelper()
50 Ω("a helper failed").Should(Equal("nope"))
51 }
52
53 var _ = It("tracks line numbers correctly when GinkgoHelper() is called", func() {
54 helper()
55 })
56
View as plain text