tearDownEach function

void tearDownEach(
  1. void callback()
)

Registers a function to be run after benchmarks.

This function will be called after each benchmark is run. If you want to run after each iteration of a benchmark see tearDownEach.

If this is called within a group, it applies only to tests in that group. The callback will be run before any tear-down callbacks in parent groups or at the top level.

Each callback at the top level or in a given group will be run in the reverse of the order they were declared.

Implementation

void tearDownEach(void Function() callback) => _g.tearDownEach(callback);