toStep method

TestStep toStep()

Materializes this snapshot as a TestStep that runs setUps → body → tearDowns, respecting nesting order.

Implementation

TestStep toStep() {
  return TestStep(
    name: name,
    action: () async {
      for (final s in setUps) {
        await s();
      }
      try {
        await body();
      } finally {
        for (final t in tearDowns) {
          await t();
        }
      }
    },
  );
}