Skip to content

Commit dca77c8

Browse files
committedJan 17, 2024
fix outline when using nodot inginkgo v2
1 parent 96e915c commit dca77c8

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed
 
+15
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
11
Name,Text,Start,End,Spec,Focused,Pending,Labels
2+
Describe,NodotFixture,71,614,false,false,false,""
3+
Describe,normal,113,233,false,false,false,""
4+
It,normal,150,229,true,false,false,""
5+
By,normal,182,201,false,false,false,""
6+
By,normal,205,224,false,false,false,""
7+
Context,normal,236,310,false,false,false,""
8+
It,normal,272,306,true,false,false,""
9+
When,normal,313,384,false,false,false,""
10+
It,normal,346,380,true,false,false,""
11+
It,normal,387,420,true,false,false,""
12+
Specify,normal,423,461,true,false,false,""
13+
DescribeTable,normal,464,536,false,false,false,""
14+
Entry,normal,510,532,true,false,false,""
15+
DescribeTable,normal,539,611,false,false,false,""
16+
Entry,normal,585,607,true,false,false,""
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[]
1+
[{"name":"Describe","text":"NodotFixture","start":71,"end":614,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"Describe","text":"normal","start":113,"end":233,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"It","text":"normal","start":150,"end":229,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"By","text":"normal","start":182,"end":201,"spec":false,"focused":false,"pending":false,"labels":null,"nodes":[]},{"name":"By","text":"normal","start":205,"end":224,"spec":false,"focused":false,"pending":false,"labels":null,"nodes":[]}]}]},{"name":"Context","text":"normal","start":236,"end":310,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"It","text":"normal","start":272,"end":306,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]}]},{"name":"When","text":"normal","start":313,"end":384,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"It","text":"normal","start":346,"end":380,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]}]},{"name":"It","text":"normal","start":387,"end":420,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]},{"name":"Specify","text":"normal","start":423,"end":461,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]},{"name":"DescribeTable","text":"normal","start":464,"end":536,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"Entry","text":"normal","start":510,"end":532,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]}]},{"name":"DescribeTable","text":"normal","start":539,"end":611,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"Entry","text":"normal","start":585,"end":607,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[]}]}]}]

‎ginkgo/outline/ginkgo.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package outline
22

33
import (
4-
"github.com/onsi/ginkgo/v2/types"
54
"go/ast"
65
"go/token"
76
"strconv"
7+
8+
"github.com/onsi/ginkgo/v2/types"
89
)
910

1011
const (

‎ginkgo/outline/import.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ func packageNameForImport(f *ast.File, path string) *string {
2828
}
2929
name := spec.Name.String()
3030
if name == "<nil>" {
31-
// If the package name is not explicitly specified,
32-
// make an educated guess. This is not guaranteed to be correct.
33-
lastSlash := strings.LastIndex(path, "/")
34-
if lastSlash == -1 {
35-
name = path
36-
} else {
37-
name = path[lastSlash+1:]
38-
}
31+
name = "ginkgo"
3932
}
4033
if name == "." {
4134
name = ""

0 commit comments

Comments
 (0)
Please sign in to comment.