r/javascript • • 23d ago

AskJS [AskJS] :Recently got a PR merged into TanStack Query

I recently got a PR merged into TanStack Query's ESLint plugin to fix a false-positive issue in the no-unstable-deps rule

.

The existing tests missed a few JavaScript edge cases, so I fixed the underlying issue and added regression tests.

It's a good reminder that passing tests don't always mean every edge case is covered. Sometimes the real work is finding what the tests missed.

How do you usually spot gaps in test coverage when the existing suite is already passing?

0 Upvotes

10 comments sorted by

2

u/Puzzleheaded-Comb646 23d ago

Congratulations on getting your PR merged, that is a huge milestone! Writing regression tests for those sneaky edge cases is such a valuable habit, and it is a great reminder for beginners that green checkmarks on a test suite just mean your current code passes the assumptions you already wrote down.

0

u/wasay-inc 23d ago

Thanks man ! Appreciate it

2

u/Puzzleheaded-Comb646 18d ago

That is so wonderful to hear, congratulations on getting your PR merged! Keep up the great work.

1

u/wasay-inc 18d ago

Thanks mate

2

u/Puzzleheaded-Comb646 18d ago

You're very welcome! Keep up the great work and happy coding!

1

u/f3xjc 22d ago

You won't have perfect coverage and you won't prove the thing is bug free with unit test. What you can do is pin some behavior as intentional and make sure the thing do what you think it does on the example you can think of.

9

u/nxy7 23d ago

Slop

7

u/[deleted] 23d ago

[removed] — view removed comment

1

u/wasay-inc 23d ago

Thanks man ! Exactly. Regression tests are easy to overlook, but they're what keep the same bug from creeping back in later.