-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Summary
As far as I can tell, neotest-go currently lacks support to run individual nested subtests. Specificallly, it will fail to initiate the right sub-subtest when running the nearest test. I'm working on a PR to add support.
Root cause
The utils.get_prefix, which derives the test to pass to go test -run, assumes that subtests only go one level deep. I fixed that for now, but the results still aren't parsed correctly - I'll publish my PR once I fix that.
Reproduction steps
Create a test file as such:
package main
import (
"testing"
"github.com/test-go/testify/require"
)
func TestHello(t *testing.T) {
t.Run("World", func(t *testing.T) {
require.Equal(t, "Hello, World!", hello("World"))
})
t.Run("Afterlife", func(t *testing.T) {
t.Run("Heaven", func(t *testing.T) {
require.Equal(t, "Hello, Heaven!", hello("Heaven"))
})
t.Run("Hell", func(t *testing.T) {
require.Equal(t, "Hello, Hell!", hello("Hell"))
})
})
}- Hover over
t.Run("World", ...and runrequire("neotest").run.run(), observe that the test runs correctly. - Hover over
t.Run("Heaven", .., and runrequire("neotest").run.run(), observe that the test is skipped.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels