3 ms·
That test is asserting a flow, not features. How can you be sure that the second rollback fails because that rollback code is wrong and not because the previous
by TrianguloY 4y ago
That test is asserting a flow, not features. How can you be sure that the second rollback fails because that rollback code is wrong and not because the previous two functions made some unexpected changes? Or rather, how can you be sure that the second rollback is ok if you dont know the state it was run from? Maybe the migration set an unexpected flag that made the rollbacks pass that test without working properly.
This is also the reason why tests should be run in arbitrary order, to avoid unexpected interactions due to order.
Flow tests can be useful in some situations, but they should never replace individual feature tests.