Skip to main content

Function: capture()

Call Signature

capture<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(method): ArgCaptor10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>

Defined in: ts-mockito.ts:159

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

T5

T5

T6

T6

T7

T7

T8

T8

T9

T9

Parameters

method

(a, b, c, d, e, f, g, h, i, j) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3, T4, T5, T6, T7, T8>(method): ArgCaptor9<T0, T1, T2, T3, T4, T5, T6, T7, T8>

Defined in: ts-mockito.ts:160

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

T5

T5

T6

T6

T7

T7

T8

T8

Parameters

method

(a, b, c, d, e, f, g, h, i) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor9<T0, T1, T2, T3, T4, T5, T6, T7, T8>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3, T4, T5, T6, T7>(method): ArgCaptor8<T0, T1, T2, T3, T4, T5, T6, T7>

Defined in: ts-mockito.ts:161

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

T5

T5

T6

T6

T7

T7

Parameters

method

(a, b, c, d, e, f, g, h) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor8<T0, T1, T2, T3, T4, T5, T6, T7>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3, T4, T5, T6>(method): ArgCaptor7<T0, T1, T2, T3, T4, T5, T6>

Defined in: ts-mockito.ts:162

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

T5

T5

T6

T6

Parameters

method

(a, b, c, d, e, f, g) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor7<T0, T1, T2, T3, T4, T5, T6>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3, T4, T5>(method): ArgCaptor6<T0, T1, T2, T3, T4, T5>

Defined in: ts-mockito.ts:163

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

T5

T5

Parameters

method

(a, b, c, d, e, f) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor6<T0, T1, T2, T3, T4, T5>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3, T4>(method): ArgCaptor5<T0, T1, T2, T3, T4>

Defined in: ts-mockito.ts:164

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

T4

T4

Parameters

method

(a, b, c, d, e) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor5<T0, T1, T2, T3, T4>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2, T3>(method): ArgCaptor4<T0, T1, T2, T3>

Defined in: ts-mockito.ts:165

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

T3

T3

Parameters

method

(a, b, c, d) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor4<T0, T1, T2, T3>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1, T2>(method): ArgCaptor3<T0, T1, T2>

Defined in: ts-mockito.ts:166

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

T2

T2

Parameters

method

(a, b, c) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor3<T0, T1, T2>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0, T1>(method): ArgCaptor2<T0, T1>

Defined in: ts-mockito.ts:167

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

T1

T1

Parameters

method

(a, b) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor2<T0, T1>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();

Call Signature

capture<T0>(method): ArgCaptor1<T0>

Defined in: ts-mockito.ts:168

Captures the arguments of previous calls to a mocked method, so they can be inspected individually. Overloaded for up to 10 arguments; each overload types the tuple returned by the captor to match that arity.

Type Parameters

T0

T0

Parameters

method

(a) => any

the mocked method itself, not a call to it, e.g. mockedFoo.sumTwoNumbers

Returns

ArgCaptor1<T0>

a captor with .first(), .second(), .third(), .beforeLast(), .last() and .byCallIndex(n), each returning the tuple of arguments passed on that call

Example

foo.sumTwoNumbers(1, 2);
const [first, second] = capture(mockedFoo.sumTwoNumbers).last();