-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix json output #82
Fix json output #82
Conversation
ab848cf
to
45cf6ca
Compare
@sergii4 still outputs JSON here, when having the cursor on line 9 and running "run nearest test". |
func TestOdd(t *testing.T) { | ||
t.Run("odd", func(t *testing.T) { | ||
t.Run("5 is odd", func(t *testing.T) { | ||
if 5%2 != 1 { | ||
t.Error("5 is actually odd") | ||
} | ||
}) | ||
t.Run("7 is odd", func(t *testing.T) { | ||
if 7%2 != 1 { | ||
t.Error("7 is actually odd") | ||
} | ||
}) | ||
|
||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sergii4 You did not use a three-level test, it's just two levels deep. You should try this:
func TestOdd(t *testing.T) { | |
t.Run("odd", func(t *testing.T) { | |
t.Run("5 is odd", func(t *testing.T) { | |
if 5%2 != 1 { | |
t.Error("5 is actually odd") | |
} | |
}) | |
t.Run("7 is odd", func(t *testing.T) { | |
if 7%2 != 1 { | |
t.Error("7 is actually odd") | |
} | |
}) | |
}) | |
} | |
func TestOdd(t *testing.T) { | |
t.Run("odd", func(t *testing.T) { | |
t.Run("5 is odd", func(t *testing.T) { | |
if 5%2 != 1 { | |
t.Error("5 is actually odd") | |
} | |
t.Run("7 is odd", func(t *testing.T) { | |
if 7%2 != 1 { | |
t.Error("7 is actually odd") | |
} | |
}) | |
}) | |
}) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looking into it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sergii4 do you think this is related?
- Issue: "Run nearest" runs all tests #83
- PR: feat: use --run flag when executing single test ( run single test instead of all of them ) #81
I'm thinking that you're getting a variable amount of temporary files written right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#83 is related, same nested tests problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems as neotest/tree-sitter upstream problem to me. I keep looking
7136726
to
d9f9eff
Compare
@fredrikaverpil should work now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, no more JSON output!! Awesome @sergii4 🎉🎉🎉
❤️ 🚀
@fredrikaverpil thanks for collaboration and examples! |
Another attempt to fix #52, #80