Contents

prepare(for:)

Prepare to run the test that has this trait.

Declaration

func prepare(for test: Test) async throws

Parameters

  • test:

    The test that has this trait.

Discussion

The testing library calls this method after it discovers all tests and their traits, and before it begins to run any tests. Use this method to prepare necessary internal state, or to determine whether the test should run.

The default implementation of this method does nothing.

See Also

Running code before and after a test or suite