Interface SinonSpy

Hierarchy

Index

Call signatures

Properties

Methods

Call signatures

(args?: Array<any>): any

Parameters

  • args?: Array<any> optional

Returns

any

Properties

public args: Array<any[]>

public callCount: number

public called: boolean

public calledOnce: boolean

public calledThrice: boolean

public calledTwice: boolean

public exception: any

public exceptions: Array<any>

public firstCall: SinonSpyCall

public lastCall: SinonSpyCall

public notCalled: boolean

public returnValue: any

public returnValues: Array<any>

public secondCall: SinonSpyCall

public thirdCall: SinonSpyCall

public thisValue: any

public thisValues: Array<any>

Methods

public alwaysCalledOn(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public alwaysCalledWith(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public alwaysCalledWithExactly(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public alwaysCalledWithMatch(args?: SinonMatcher[]): boolean

Parameters

Returns

boolean

public alwaysReturned(): boolean

Returns

boolean

public alwaysThrew(): boolean

Returns

boolean

public alwaysThrew(type: string): boolean

Parameters

  • type: string

Returns

boolean

public alwaysThrew(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public callArg(pos: number)

Parameters

  • pos: number

public callArgOn(pos: number, obj: any, args?: Array<any>)

Parameters

  • pos: number
  • obj: any
  • args?: Array<any> optional

public callArgOnWith(pos: number, obj: any, args?: Array<any>)

Parameters

  • pos: number
  • obj: any
  • args?: Array<any> optional

public callArgWith(pos: number, args?: Array<any>)

Parameters

  • pos: number
  • args?: Array<any> optional

public calledAfter(anotherSpy: SinonSpy): boolean

Parameters

Returns

boolean

public calledBefore(anotherSpy: SinonSpy): boolean

Parameters

Returns

boolean

public calledOn(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public calledWith(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public calledWithExactly(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public calledWithMatch(args?: SinonMatcher[]): boolean

Parameters

Returns

boolean

public calledWithNew(spy: SinonSpy): boolean

Parameters

Returns

boolean

public getCall(n: number): SinonSpyCall

Parameters

  • n: number

Returns

SinonSpyCall

public invokeCallback(args?: Array<any>)

Parameters

  • args?: Array<any> optional

public neverCalledWith(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public neverCalledWithMatch(args?: SinonMatcher[]): boolean

Parameters

Returns

boolean

public notCalledWith(args?: Array<any>): boolean

Parameters

  • args?: Array<any> optional

Returns

boolean

public notCalledWithMatch(args?: SinonMatcher[]): boolean

Parameters

Returns

boolean

public printf(format: string, args?: Array<any>): string

Parameters

  • format: string
  • args?: Array<any> optional

Returns

string

public reset()

public restore()

public returned(value: any): boolean

Parameters

  • value: any

Returns

boolean

public threw(): boolean

Returns

boolean

public threw(type: string): boolean

Parameters

  • type: string

Returns

boolean

public threw(obj: any): boolean

Parameters

  • obj: any

Returns

boolean

public withArgs(args?: Array<any>): SinonSpy

Parameters

  • args?: Array<any> optional

Returns

SinonSpy

public yield(args?: Array<any>)

Parameters

  • args?: Array<any> optional

public yieldOn(obj: any, args?: Array<any>)

Parameters

  • obj: any
  • args?: Array<any> optional

public yieldTo(property: string, args?: Array<any>)

Parameters

  • property: string
  • args?: Array<any> optional

public yieldToOn(property: string, obj: any, args?: Array<any>)

Parameters

  • property: string
  • obj: any
  • args?: Array<any> optional