Skip to content

Commit

Permalink
Adds 'outline' package that creates an outline of Ginkgo specs/contai…
Browse files Browse the repository at this point in the history
…ners in a file

Implements feature request in onsi#753
  • Loading branch information
dlipovetsky committed Dec 26, 2020
1 parent efb9e69 commit b08408c
Show file tree
Hide file tree
Showing 12 changed files with 657 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ginkgo/outline/_testdata/focused_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package example_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
)

var _ = Describe("FocusedFixture", func() {
FDescribe("focused", func() {
It("focused", func() {

})
})

FContext("focused", func() {
It("focused", func() {

})
})

FWhen("focused", func() {
It("focused", func() {

})
})

FIt("focused", func() {

})

FSpecify("focused", func() {

})

FMeasure("focused", func(b Benchmarker) {

}, 2)

FDescribeTable("focused",
func() {},
Entry("focused"),
)

DescribeTable("focused",
func() {},
FEntry("focused"),
)
})
90 changes: 90 additions & 0 deletions ginkgo/outline/_testdata/focused_test_outline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"name": "Describe",
"position": "_testdata/focused_test.go:8:9",
"text": "FocusedFixture",
"spec": false,
"focused": false,
"pending": false,
"nodes": [
{
"name": "FDescribe",
"position": "_testdata/focused_test.go:9:2",
"text": "focused",
"spec": false,
"focused": true,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/focused_test.go:10:3",
"text": "focused",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "FContext",
"position": "_testdata/focused_test.go:15:2",
"text": "focused",
"spec": false,
"focused": true,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/focused_test.go:16:3",
"text": "focused",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "FWhen",
"position": "_testdata/focused_test.go:21:2",
"text": "focused",
"spec": false,
"focused": true,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/focused_test.go:22:3",
"text": "focused",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "FIt",
"position": "_testdata/focused_test.go:27:2",
"text": "focused",
"spec": true,
"focused": true,
"pending": false
},
{
"name": "FSpecify",
"position": "_testdata/focused_test.go:31:2",
"text": "focused",
"spec": true,
"focused": true,
"pending": false
},
{
"name": "FMeasure",
"position": "_testdata/focused_test.go:35:2",
"text": "focused",
"spec": true,
"focused": true,
"pending": false
}
]
}
]
48 changes: 48 additions & 0 deletions ginkgo/outline/_testdata/normal_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package example_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
)

var _ = Describe("NormalFixture", func() {
Describe("normal", func() {
It("normal", func() {

})
})

Context("normal", func() {
It("normal", func() {

})
})

When("normal", func() {
It("normal", func() {

})
})

It("normal", func() {

})

Specify("normal", func() {

})

Measure("normal", func(b Benchmarker) {

}, 2)

DescribeTable("normal",
func() {},
Entry("normal"),
)

DescribeTable("normal",
func() {},
Entry("normal"),
)
})
90 changes: 90 additions & 0 deletions ginkgo/outline/_testdata/normal_test_outline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"name": "Describe",
"position": "_testdata/normal_test.go:8:9",
"text": "NormalFixture",
"spec": false,
"focused": false,
"pending": false,
"nodes": [
{
"name": "Describe",
"position": "_testdata/normal_test.go:9:2",
"text": "normal",
"spec": false,
"focused": false,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/normal_test.go:10:3",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "Context",
"position": "_testdata/normal_test.go:15:2",
"text": "normal",
"spec": false,
"focused": false,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/normal_test.go:16:3",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "When",
"position": "_testdata/normal_test.go:21:2",
"text": "normal",
"spec": false,
"focused": false,
"pending": false,
"nodes": [
{
"name": "It",
"position": "_testdata/normal_test.go:22:3",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
}
]
},
{
"name": "It",
"position": "_testdata/normal_test.go:27:2",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
},
{
"name": "Specify",
"position": "_testdata/normal_test.go:31:2",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
},
{
"name": "Measure",
"position": "_testdata/normal_test.go:35:2",
"text": "normal",
"spec": true,
"focused": false,
"pending": false
}
]
}
]
48 changes: 48 additions & 0 deletions ginkgo/outline/_testdata/pending_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package example_test

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
)

var _ = Describe("PendingFixture", func() {
PDescribe("pending", func() {
It("pending", func() {

})
})

PContext("pending", func() {
It("pending", func() {

})
})

PWhen("pending", func() {
It("pending", func() {

})
})

PIt("pending", func() {

})

PSpecify("pending", func() {

})

PMeasure("pending", func(b Benchmarker) {

}, 2)

PDescribeTable("pending",
func() {},
Entry("pending"),
)

DescribeTable("pending",
func() {},
PEntry("pending"),
)
})

0 comments on commit b08408c

Please sign in to comment.