I'm evaluating ginkgo
at the moment - I very much like the BDD style.
However I'm unable at the moment to get the VS Code debugger to work with the framework. The official VS-Code extension provides test-by-test debugging for native go tests using CodeLens. With other languages and frameworks (eg Typescript/Mocha), I've been able to debug individual test files by setting up launch.json
appropriately, but have been unable to find suitable examples for go
.
Does anybody have any examples of any launch.json
setups for debugging ginkgo
tests (or go code invoked from any other framework)?
Thanks!
After a bit of playing around I found a way forward which perhaps should have been obvious. In case it isn't I'll leave the question and this answer here:
For a package foo
, a foo_suite_test.go
file is generated by the gingko bootstrap
command. This contains a top-level test called TestFoo
which runs the rest of the tests within the package.
This does have a CodeLens run test | debug test
section above it which you can use to debug the entire suite.
It's not quite as convenient as the individual CodeLens entries which appear over each native go test, but it's easy enough to isolate specific tests to run using the Gingko F
prefix.