strong-mock 9.0.1 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -25
- package/dist/index.cjs +1191 -0
- package/dist/index.d.cts +584 -0
- package/dist/index.d.ts +584 -14
- package/dist/index.js +658 -842
- package/package.json +35 -21
- package/dist/errors/api.d.ts +0 -13
- package/dist/errors/diff.d.ts +0 -4
- package/dist/errors/unexpected-access.d.ts +0 -5
- package/dist/errors/unexpected-call.d.ts +0 -14
- package/dist/errors/verify.d.ts +0 -8
- package/dist/expectation/expectation.d.ts +0 -27
- package/dist/expectation/repository/expectation-repository.d.ts +0 -90
- package/dist/expectation/repository/flexible-repository.d.ts +0 -38
- package/dist/expectation/repository/return-value.d.ts +0 -13
- package/dist/expectation/strong-expectation.d.ts +0 -30
- package/dist/index.js.map +0 -1
- package/dist/matchers/contains-object.d.ts +0 -28
- package/dist/matchers/deep-equals.d.ts +0 -16
- package/dist/matchers/is-any.d.ts +0 -11
- package/dist/matchers/is-array.d.ts +0 -22
- package/dist/matchers/is-number.d.ts +0 -12
- package/dist/matchers/is-plain-object.d.ts +0 -17
- package/dist/matchers/is-string.d.ts +0 -15
- package/dist/matchers/is.d.ts +0 -9
- package/dist/matchers/it.d.ts +0 -10
- package/dist/matchers/matcher.d.ts +0 -93
- package/dist/matchers/will-capture.d.ts +0 -21
- package/dist/mock/defaults.d.ts +0 -11
- package/dist/mock/map.d.ts +0 -16
- package/dist/mock/mock.d.ts +0 -24
- package/dist/mock/mode.d.ts +0 -6
- package/dist/mock/options.d.ts +0 -99
- package/dist/mock/stub.d.ts +0 -5
- package/dist/print.d.ts +0 -10
- package/dist/proxy.d.ts +0 -48
- package/dist/return/invocation-count.d.ts +0 -44
- package/dist/return/returns.d.ts +0 -61
- package/dist/verify/reset.d.ts +0 -20
- package/dist/verify/verify.d.ts +0 -27
- package/dist/when/expectation-builder.d.ts +0 -26
- package/dist/when/when.d.ts +0 -32
package/dist/when/when.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { NonPromiseStub, PromiseStub } from '../return/returns';
|
|
2
|
-
interface When {
|
|
3
|
-
<R>(expectation: () => Promise<R>): PromiseStub<R, Promise<R>>;
|
|
4
|
-
<R>(expectation: () => R): NonPromiseStub<R>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Set an expectation on a mock.
|
|
8
|
-
*
|
|
9
|
-
* The expectation must be finished by setting a return value, even if the value
|
|
10
|
-
* is `undefined`.
|
|
11
|
-
*
|
|
12
|
-
* If a call happens that was not expected then the mock will throw an error.
|
|
13
|
-
* By default, the call is expected to only be made once. Use the invocation
|
|
14
|
-
* count helpers to expect a call multiple times.
|
|
15
|
-
*
|
|
16
|
-
* @param expectation A callback to set the expectation on your mock. The
|
|
17
|
-
* callback must return the value from the mock to properly infer types.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const fn = mock<() => void>();
|
|
21
|
-
* when(() => fn()).thenReturn(undefined);
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const fn = mock<() => number>();
|
|
25
|
-
* when(() => fn()).thenReturn(42).atMost(3);
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* const fn = mock<(x: number) => Promise<number>();
|
|
29
|
-
* when(() => fn(23)).thenResolve(42);
|
|
30
|
-
*/
|
|
31
|
-
export declare const when: When;
|
|
32
|
-
export {};
|