xunit~TestResult()

Accumulated results from running a TestCase.

new TestResult()

Members

errors :Array.<module:xunit~TestResult~MethodResult>

Unexpected exceptions.

failures :Array.<module:xunit~TestResult~MethodResult>

Explicit test failures.

skipped :Array.<module:xunit~TestResult~MethodResult>

Skipped tests.

successes :Array.<module:xunit~TestResult~MethodResult>

Successes.

tests :Map.<string, module:xunit~TestExecution>

All test executions.

Methods

addError(methodName, exception)

Record an unexpected exception from a execution.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

exception Error

Exception caught.

addFailure(methodName, message)

Record a test failure.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

message string

Message from the test or framework.

addSkip(methodName, message)

Record a test skipped.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

message string

Reason the test was skipped.

addSuccess(methodName)

Record a successful execution.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

startTest(methodName)

Record the start of a test execution.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

stopTest(methodName)

Record the stop of a test execution.

Parameters:
Name Type Description
methodName string

Name of the associated module:xunit.TestCase method.

summary(formattedopt) → {Array.<string>}

Text summary of the results.

Useful for test runners.

Parameters:
Name Type Attributes Default Description
formatted boolean <optional>
false

Try to line things up in columns.

Returns:
Array.<string> -

Summary, one line per entry in the array.

wasSuccessful() → {boolean}

Returns:
boolean -

Indicates success so far.

Type Definitions

MethodResult

Properties:
Name Type Attributes Description
methodName string

Name of the associated module:xunit.TestCase method.

error string <nullable>

Name of caught exception.

message string

Message from the test or framework.