#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# Test.ComparisonFailure Class

Extends AssertionError
Defined in: `test/js/ComparisonFailure.js:1`
Module: test

ComparisonFailure is subclass of Error that is thrown whenever a comparison between two values fails. It provides mechanisms to retrieve both the expected and actual value.

- Index
- Methods
- Properties

## Item Index

### Methods

- getMessage

### Properties

- actual
- expected
- name

## Methods

### `getMessage`

() String

Defined in `test/js/ComparisonFailure.js:49`

Returns a fully formatted error for an assertion failure. This message provides information about the expected and actual values.

#### Returns:

String: A string describing the error.

## Properties

### `actual`

Object

Defined in `test/js/ComparisonFailure.js:27`

The actual value.

### `expected`

Object

Defined in `test/js/ComparisonFailure.js:20`

The expected value.

### `name`

String

Defined in `test/js/ComparisonFailure.js:34`

The name of the error that occurred.