run method

void run([
  1. CodeRun? testCallback
])

Executes the BDD scenario as a standard Dart unit test.

This method uses the BddRunner to orchestrate step execution and delegates the underlying test lifecycle management to package:test. Exceptions and failed assertions are recorded in the BDD report and also fail the underlying test, including errors from asynchronous steps.

Implementation

void run([CodeRun? testCallback]) {
  BddRunner().run(
    bdd,
    testCallback ?? (ctx) async {}, // Default empty CodeRun
    _testDelegate,
    null, // Print the original error and stack trace before failing the test.
    () => true,
  );
}