Skip to main content

UnitPlan

Type​

statement

Summary​

Announce how many test results are expected from the unit test.

Syntax​

plan <Count> tests

Description​

Log the number of unit test assertions which are expected to occur in the current unit test. This may be used by the test framework to flag an error if too few test results appear in the test result. For example, this allows the test framework to detect whether a unit test failed silently.

Using plan _ tests is optional, and a unit test is valid even if its omitted.

Examples​

plan 3 tests
Thank you for your feedback!

Was this page helpful?