Added `invoked` helper to write tests.