Closed krhubert closed 3 weeks ago
Just on the face of it I feel like a "check every job ran at least once" test helper would be a little too specific of a use case to build into something like rivertest
.
What do you think about using the job list API with Client.JobList
in a post-test block and iterating through them to make sure everything you wanted is in there?
@brandur As long as I can create a solution that ensures our code is tested, and at the same time a dev can't opt out of that check, then my problem is solved. So this is perfect, thank you for your suggestion.
EDITED:
I just found an issue about hooks https://github.com/riverqueue/river/issues/122 and https://github.com/riverqueue/river/discussions/167, but I'm not sure what's the status of it.
I want to ensure that everything in the project is tested. Reviews are great for that, but failing tests are even more powerful.
Is there a way to ensure each job has been called at least once? A helper can do this in rivertest. Another options are hooks/interceptors/middlewares. By having those, implementing checks is possible. Or maybe there's currently an API that allows this?
I guess the description might be clear enough this is why I have a code example that demonstrates what I'm talking about but for HTTP.