strong-mock 8.0.0 → 9.0.0-beta.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 +53 -31
- package/dist/errors/api.d.ts +13 -0
- package/dist/errors/unexpected-access.d.ts +5 -0
- package/dist/errors/unexpected-call.d.ts +17 -0
- package/dist/errors/verify.d.ts +8 -0
- package/dist/expectation/expectation.d.ts +27 -30
- package/dist/expectation/repository/expectation-repository.d.ts +90 -90
- package/dist/expectation/repository/flexible-repository.d.ts +38 -38
- package/dist/expectation/repository/return-value.d.ts +13 -13
- package/dist/expectation/strong-expectation.d.ts +30 -30
- package/dist/index.d.ts +14 -9
- package/dist/index.js +815 -512
- package/dist/index.js.map +1 -1
- package/dist/matchers/deep-equals.d.ts +16 -0
- package/dist/matchers/is-any.d.ts +11 -0
- package/dist/matchers/is-array.d.ts +22 -0
- package/dist/matchers/is-number.d.ts +12 -0
- package/dist/matchers/is-object.d.ts +27 -0
- package/dist/matchers/is-string.d.ts +15 -0
- package/dist/matchers/is.d.ts +9 -0
- package/dist/matchers/it.d.ts +9 -0
- package/dist/matchers/matcher.d.ts +92 -0
- package/dist/matchers/will-capture.d.ts +21 -0
- package/dist/mock/defaults.d.ts +11 -11
- package/dist/mock/map.d.ts +16 -16
- package/dist/mock/mock.d.ts +29 -29
- package/dist/mock/options.d.ts +99 -99
- package/dist/mock/stub.d.ts +5 -5
- package/dist/print.d.ts +10 -10
- package/dist/proxy.d.ts +48 -48
- package/dist/return/invocation-count.d.ts +44 -44
- package/dist/return/returns.d.ts +61 -77
- package/dist/verify/reset.d.ts +20 -20
- package/dist/verify/verify.d.ts +27 -27
- package/dist/when/{pending-expectation.d.ts → expectation-builder.d.ts} +26 -31
- package/dist/when/when.d.ts +32 -32
- package/package.json +20 -16
- package/dist/errors.d.ts +0 -28
- package/dist/expectation/it.d.ts +0 -29
- package/dist/expectation/matcher.d.ts +0 -21
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { ReturnValue } from './repository/return-value';
|
|
5
|
-
/**
|
|
6
|
-
* Matches a call with more parameters than expected because it is assumed the
|
|
7
|
-
* compiler will check that those parameters are optional.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* new StrongExpectation(
|
|
11
|
-
* 'bar',
|
|
12
|
-
* deepEquals([1, 2, 3]),
|
|
13
|
-
* 23
|
|
14
|
-
* ).matches('bar', [1, 2, 3]) === true;
|
|
15
|
-
*/
|
|
16
|
-
export declare class StrongExpectation implements Expectation {
|
|
17
|
-
property: Property;
|
|
18
|
-
args: Matcher[] | undefined;
|
|
19
|
-
returnValue: ReturnValue;
|
|
20
|
-
private exactParams;
|
|
21
|
-
private matched;
|
|
22
|
-
min: number;
|
|
23
|
-
max: number;
|
|
24
|
-
constructor(property: Property, args: Matcher[] | undefined, returnValue: ReturnValue, exactParams?: boolean);
|
|
25
|
-
setInvocationCount(min: number, max?: number): void;
|
|
26
|
-
matches(args: any[] | undefined): boolean;
|
|
27
|
-
isUnmet(): boolean;
|
|
28
|
-
private matchesArgs;
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
import type { Matcher } from '../matchers/matcher';
|
|
2
|
+
import type { Property } from '../proxy';
|
|
3
|
+
import type { Expectation } from './expectation';
|
|
4
|
+
import type { ReturnValue } from './repository/return-value';
|
|
5
|
+
/**
|
|
6
|
+
* Matches a call with more parameters than expected because it is assumed the
|
|
7
|
+
* compiler will check that those parameters are optional.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* new StrongExpectation(
|
|
11
|
+
* 'bar',
|
|
12
|
+
* deepEquals([1, 2, 3]),
|
|
13
|
+
* 23
|
|
14
|
+
* ).matches('bar', [1, 2, 3]) === true;
|
|
15
|
+
*/
|
|
16
|
+
export declare class StrongExpectation implements Expectation {
|
|
17
|
+
property: Property;
|
|
18
|
+
args: Matcher[] | undefined;
|
|
19
|
+
returnValue: ReturnValue;
|
|
20
|
+
private exactParams;
|
|
21
|
+
private matched;
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
constructor(property: Property, args: Matcher[] | undefined, returnValue: ReturnValue, exactParams?: boolean);
|
|
25
|
+
setInvocationCount(min: number, max?: number): void;
|
|
26
|
+
matches(args: any[] | undefined): boolean;
|
|
27
|
+
isUnmet(): boolean;
|
|
28
|
+
private matchesArgs;
|
|
29
|
+
toString(): string;
|
|
30
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
export { mock } from './mock/mock';
|
|
2
|
-
export { when } from './when/when';
|
|
3
|
-
export { reset, resetAll } from './verify/reset';
|
|
4
|
-
export { verify, verifyAll } from './verify/verify';
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export { mock } from './mock/mock';
|
|
2
|
+
export { when } from './when/when';
|
|
3
|
+
export { reset, resetAll } from './verify/reset';
|
|
4
|
+
export { verify, verifyAll } from './verify/verify';
|
|
5
|
+
export { setDefaults } from './mock/defaults';
|
|
6
|
+
import * as It from './matchers/it';
|
|
7
|
+
/**
|
|
8
|
+
* Contains matchers that can be used to ignore arguments in an
|
|
9
|
+
* expectation or to match complex arguments.
|
|
10
|
+
*/
|
|
11
|
+
export { It };
|
|
12
|
+
export type { Matcher, MatcherOptions } from './matchers/matcher';
|
|
13
|
+
export type { MockOptions } from './mock/options';
|
|
14
|
+
export { UnexpectedProperty } from './mock/options';
|