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.
Files changed (40) hide show
  1. package/README.md +53 -31
  2. package/dist/errors/api.d.ts +13 -0
  3. package/dist/errors/unexpected-access.d.ts +5 -0
  4. package/dist/errors/unexpected-call.d.ts +17 -0
  5. package/dist/errors/verify.d.ts +8 -0
  6. package/dist/expectation/expectation.d.ts +27 -30
  7. package/dist/expectation/repository/expectation-repository.d.ts +90 -90
  8. package/dist/expectation/repository/flexible-repository.d.ts +38 -38
  9. package/dist/expectation/repository/return-value.d.ts +13 -13
  10. package/dist/expectation/strong-expectation.d.ts +30 -30
  11. package/dist/index.d.ts +14 -9
  12. package/dist/index.js +815 -512
  13. package/dist/index.js.map +1 -1
  14. package/dist/matchers/deep-equals.d.ts +16 -0
  15. package/dist/matchers/is-any.d.ts +11 -0
  16. package/dist/matchers/is-array.d.ts +22 -0
  17. package/dist/matchers/is-number.d.ts +12 -0
  18. package/dist/matchers/is-object.d.ts +27 -0
  19. package/dist/matchers/is-string.d.ts +15 -0
  20. package/dist/matchers/is.d.ts +9 -0
  21. package/dist/matchers/it.d.ts +9 -0
  22. package/dist/matchers/matcher.d.ts +92 -0
  23. package/dist/matchers/will-capture.d.ts +21 -0
  24. package/dist/mock/defaults.d.ts +11 -11
  25. package/dist/mock/map.d.ts +16 -16
  26. package/dist/mock/mock.d.ts +29 -29
  27. package/dist/mock/options.d.ts +99 -99
  28. package/dist/mock/stub.d.ts +5 -5
  29. package/dist/print.d.ts +10 -10
  30. package/dist/proxy.d.ts +48 -48
  31. package/dist/return/invocation-count.d.ts +44 -44
  32. package/dist/return/returns.d.ts +61 -77
  33. package/dist/verify/reset.d.ts +20 -20
  34. package/dist/verify/verify.d.ts +27 -27
  35. package/dist/when/{pending-expectation.d.ts → expectation-builder.d.ts} +26 -31
  36. package/dist/when/when.d.ts +32 -32
  37. package/package.json +20 -16
  38. package/dist/errors.d.ts +0 -28
  39. package/dist/expectation/it.d.ts +0 -29
  40. package/dist/expectation/matcher.d.ts +0 -21
@@ -1,30 +1,30 @@
1
- import type { Property } from '../proxy';
2
- import type { Expectation } from './expectation';
3
- import type { Matcher } from './matcher';
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
- toJSON(): string;
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 { It } from './expectation/it';
6
- export { setDefaults } from './mock/defaults';
7
- export type { Matcher } from './expectation/matcher';
8
- export type { MockOptions } from './mock/options';
9
- export { UnexpectedProperty } from './mock/options';
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';