Live data from Hacker News

Show HN: I built a tool to get instant test results

github.com

21–30 of 68 posts

Re: Show HN: I built a tool to get instant test results

#22

1. Does this mean I have to disable IDE autosave so it doesn't attempt to run tests when the project is in an intermediate, invalid state? 2. How does it detect what tests need to be re-run when a given file changes?

I don't think #1 matters, because it runs again once it's in a valid state again. Your test will fail while in an invalid state, but that's to be expected.

As the author explained in another comment, it initially generates the code coverage for all tests. When code is changed, only the tests that cover that code are rerun.

Re: Show HN: I built a tool to get instant test results

#23
post #17
post #10

I like the concept and it seems that "run them all and see what changed" is a great model to avoid missing any side effects from a code change. However, if you're running all the tests on every change, doesn't that mean the responsiveness is necessarily greater than 250ms if your test suite is longer than 250ms? Regardless, running tests in the background to eliminate human delay is good. It would be nice if the (~te…

This tool doesn't run all the tests, only the ones affected by the code changes since the last run. It figures out which tests to run by initially running all tests, and storing the code coverage of each test. It doesn't need to rely on "test change likelihood" - if a code change is outside of the code coverage of the test, it doesn't affect the test.

So...like gradle?

Re: Show HN: I built a tool to get instant test results

#24
post #9
post #6

I'm a bit confused how this differs from the existing watch modes that are built into test runners I'm familiar with, such as Jest. Is this something that I'm used to in TypeScript, but which just doesn't exist in most language's ecosystems?

Well, I would say the biggest difference is while the watch mode you described runs all the tests for every change. hypertest only runs the tests the were impacted by the changed code. Resulting is blazing fast performance. I’d say it’s even fast than apples alt+tab animation most of the time.

> hypertest only runs the tests the were impacted by the changed code

with all due respect, this is also a solved problem with test watchers. unless you mean this is smart enough to not just run unit tests that are directly related to the file changed, but also understands code changes from the perspective of downstream dependencies?

Re: Show HN: I built a tool to get instant test results

#25
post #22

1. Does this mean I have to disable IDE autosave so it doesn't attempt to run tests when the project is in an intermediate, invalid state? 2. How does it detect what tests need to be re-run when a given file changes?

I don't think #1 matters, because it runs again once it's in a valid state again. Your test will fail while in an invalid state, but that's to be expected. As the author explained in another comment, it initially generates the code coverage for all tests. When code is changed, only the tests that cover that code are rerun.

Furthermore, it will still display the build error + the previous failure list.

So you can always rely on that background terminal for actual test failure reasons.

Re: Show HN: I built a tool to get instant test results

#30

This is a great idea! Even better: write a Playwright/Codegen[1] test and have that execute continuously (or put a button in the IDE to trigger it). That way you can iterate on multiple code files but see how it impacts one end-to-end test in real time! (I'm developing a feature right now where I'm doing that manually and it would be nice to automate) [1] https://playwright.dev/docs/codegen-intro

collab w/ me ;)
Post reply on HN