matcher.IsA extends matcher.Matcher

Matches arguments that is the instance of the given ctor, or has the expected type.

Constructor

matcher.IsA(Function | String expectedType)

expectedType

Function | String

If function, this will check if the argument is an instance of it. If a string, this will check if typeof argument is the specified string.

Function | String expectedType

If function, this will check if the argument is an instance of it. If a string, this will check if typeof argument is the specified string.

Properties

readonly Array matchingArgs

Array of recorded arguments that matches

Methods

matches(Object arg) => Boolean

arg

Object

Object to be checked.

Object arg

Object to be checked.

return Boolean

True iff the given argument is an instance of the constructor.

registerInvocation(Object arg) => Boolean

Checks if the given argument matches the matcher. If so, records the invocation.

[arg]

Object

The argument to be checked.

Object [arg]

The argument to be checked.

return Boolean

True iff the given argument is a match.