failNext method
Fails the next count batches entirely with error.
Implementation
void failNext(int count,
{String error = 'Simulated failure', bool permanent = false}) {
for (var i = 0; i < count; i++) {
_script.add((batch) => SyncResult.allFailed(
{for (final t in batch) t.taskId: error},
permanent: permanent,
));
}
}