onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.12k stars 644 forks source link

ginkgo outline doesn't honor --nodot option #1325

Closed abourree closed 6 months ago

abourree commented 7 months ago

Environment:

$cat /etc/debian_version 
trixie/sid
$go version
go version go1.21.5 linux/amd64
$ginkgo version
Ginkgo Version 2.12.1

ginkgo outline should support test file generated with --nodot option.

For the following test file generated without --nodot option:

package issue_test

import (
        . "github.com/onsi/ginkgo/v2"
        . "github.com/onsi/gomega"
)

var _ = Describe("Blabla", func() {
        config := 0
        Expect(config).To(BeComparableTo(0))
})

The command ginkgo outline blabla_test.go output

Name,Text,Start,End,Spec,Focused,Pending,Labels
Describe,Blabla,96,177,false,false,false,""

But same test geenrated with --nodot option:

package issue_test

import (
    "github.com/onsi/ginkgo/v2"
    "github.com/onsi/gomega"
)

var _ = ginkgo.Describe("Blabla", func() {
    config := 0
    gomega.Expect(config).To(gomega.BeComparableTo(0))
})

The command ginkgo outline blabla_test.go output

Name,Text,Start,End,Spec,Focused,Pending,Labels
onsi commented 6 months ago

thanks @abourree - i have a fix for this on master now and will cut a release soon

abourree commented 6 months ago

Perfect, now Ginkgo Explorer extension in vsCode can outline and I can easy run test from my IDE :-D