Extend the jest task to support rerunning a script multiple times (like 100x) as a stress test for intermittent failures
Scenario: your jest test is intermittently failing. You have a potential local fix, and you want to increase your confidence in the change by running in a tight loop (either locally or in a lab build).
Jest does not have built-in support, and recommends doing this in a script. https://github.com/facebook/jest/issues/4336
I'm imagining a "rerun N" parameter passed to the just script, which internally would run in loop taking advantage of concurrency, and give an aggregate report.
Thoughts?
This seems like something you would do as a wrapper of a task function... would that be what you want?
Thanks for the suggestion. I'm not familiar with how a wrapper of a task function would work -- could you share an example?
Task functions are just functions, so you can call it multiple times if you need it to...
const {someTask} = require('./someTask');
module.exports = function() {
for (let i = 0; i < 1000; i++) {
someTask();
}
}
Feel free to ping me on Teams to discuss further on specifics if you need to! Closing this for now.