David-Kunz / jester

A Neovim plugin to easily run and debug Jest tests
The Unlicense
202 stars 12 forks source link

Can't find nearest test when cursor is on a comment #5

Closed kahnclusions closed 2 years ago

kahnclusions commented 2 years ago

Nice plugin!

I'm experimenting with this in a TypeScript project and noticed what may be a little bug. If the cursor is directly over a comment, then it seems like it is unable to traverse the parent nodes to find the nearest "test" block. But moving anywhere else inside the test function locates it perfectly fine.

David-Kunz commented 2 years ago

Hi @kahnclusions ,

Thanks for this report, yes, that's also something I noticed. The reason is that comments are at the top level of the AST. I will fix it as soon as I have some time!

Best regards, David

David-Kunz commented 2 years ago

Hi @kahnclusions ,

I fixed the bug: https://github.com/David-Kunz/jester/commit/68a87c5e7c9afa2d9a1d32cb6a3fc109122cbc2d, it's in the main branch so you can just upgrade your package.

It would be great if you could tell me if that fixes your problem.

Thanks again and best regards, David

kahnclusions commented 2 years ago

Yes! Can confirm it works now. Thanks for the quick fix @David-Kunz 🔧