# Yahoo! UI Library

### test 3.1.1

Yahoo! UI Library > test > Assert.UnexpectedError
Search:
Filters Show Private Show Protected Show Deprecated

## Class Assert.UnexpectedError - extends Assert.Error

UnexpectedError is subclass of Error that is thrown whenever an error occurs within the course of a test and the test was not expected to throw an error.

### Constructor

Assert.UnexpectedError `( cause )`

Parameters:
  `cause <Error>` The unexpected error that caused this error to be thrown.

### Properties

#### cause - `Error`

The unexpected error that occurred.

#### name - `String`

The name of the error that occurred.

#### stack - `String`

Stack information for the error (if provided).

#### Properties inherited from Assert.Error:

`name`

### Methods

#### JSON

`String JSON ( coverage )`
Returns the coverage report in JSON format. This is the straight JSON representation of the native coverage report.

Parameters:
  `coverage <Object>` The coverage report object.

Returns: `String`
  A JSON-formatted string of coverage data.

#### XdebugJSON

`String XdebugJSON ( coverage )`
Returns the coverage report in a JSON format compatible with Xdebug. See Xdebug Documentation for more information. Note: function coverage is not available in this format.

Parameters:
  `coverage <Object>` The coverage report object.

Returns: `String`
  A JSON-formatted string of coverage data.

#### Methods inherited from Assert.Error:

`getMessage, toString, valueOf`

Copyright © 2010 Yahoo! Inc. All rights reserved.