strong-mock 7.2.1 → 8.0.0-beta.1

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/CHANGELOG.md DELETED
@@ -1,135 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
- ### [7.2.1](https://github.com/NiGhTTraX/strong-mock/compare/v7.2.0...v7.2.1) (2021-09-08)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * Make `instance` referentially stable ([4194526](https://github.com/NiGhTTraX/strong-mock/commit/41945264343024039e89b8a0dedcf8f3ba87209a))
11
-
12
- ## [7.2.0](https://github.com/NiGhTTraX/strong-mock/compare/v7.1.2...v7.2.0) (2021-09-06)
13
-
14
-
15
- ### Features
16
-
17
- * Add `It.willCapture` ([987e391](https://github.com/NiGhTTraX/strong-mock/commit/987e3910db4abbce4ca4b65e3c54c32191e30ddd))
18
-
19
- ### [7.1.2](https://github.com/NiGhTTraX/strong-mock/compare/v7.1.1...v7.1.2) (2021-08-28)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * Allow other strong mocks in expectations ([569815b](https://github.com/NiGhTTraX/strong-mock/commit/569815b26acaff178dab70602ad705e07f352185)), closes [#254](https://github.com/NiGhTTraX/strong-mock/issues/254) [#256](https://github.com/NiGhTTraX/strong-mock/issues/256)
25
- * **deps:** update dependency jest-matcher-utils to ~27.1.0 ([b024ed0](https://github.com/NiGhTTraX/strong-mock/commit/b024ed00ba11d39bc1195a971285136f443a719d))
26
-
27
- ### [7.1.1](https://github.com/NiGhTTraX/strong-mock/compare/v7.1.0...v7.1.1) (2021-08-26)
28
-
29
- ## [7.1.0](https://github.com/NiGhTTraX/strong-mock/compare/v7.0.0...v7.1.0) (2021-06-24)
30
-
31
-
32
- ### Features
33
-
34
- * `thenReject` now lazily creates promise rejection ([01c9995](https://github.com/NiGhTTraX/strong-mock/commit/01c9995c69d00205388da6d7dba2b35d9e70e5b8)), closes [#238](https://github.com/NiGhTTraX/strong-mock/issues/238)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * Correctly throw error values from method expectations ([a1ad324](https://github.com/NiGhTTraX/strong-mock/commit/a1ad3244f8dfe7ed1e93193479e5cd347f2bf348))
40
-
41
- ## [7.0.0](https://github.com/NiGhTTraX/strong-mock/compare/v6.0.0...v7.0.0) (2021-06-17)
42
-
43
-
44
- ### ⚠ BREAKING CHANGES
45
-
46
- * Node 10 is no longer supported.
47
-
48
- ### Features
49
-
50
- * Allow mock instances to be enumerable ([850223c](https://github.com/NiGhTTraX/strong-mock/commit/850223cbd906297f07923883c554589b5d12ed53)), closes [#235](https://github.com/NiGhTTraX/strong-mock/issues/235)
51
- * Print promise values in error messages ([bc0301f](https://github.com/NiGhTTraX/strong-mock/commit/bc0301f983147d738af657ae285f696cbfa497e3))
52
-
53
-
54
- ### Bug Fixes
55
-
56
- * **deps:** update dependency jest-matcher-utils to ~26.2.0 ([52e9740](https://github.com/NiGhTTraX/strong-mock/commit/52e9740420bf0479e16f00d9f179e99714ae58fd))
57
- * **deps:** update dependency jest-matcher-utils to ~26.3.0 ([b7f483b](https://github.com/NiGhTTraX/strong-mock/commit/b7f483b8e9b3ed4585a81c3a401f7501691e38ad))
58
- * **deps:** update dependency jest-matcher-utils to ~26.4.0 ([3fe4f66](https://github.com/NiGhTTraX/strong-mock/commit/3fe4f663388724dafaa6813fd8ac02e8a0db6960))
59
- * **deps:** update dependency jest-matcher-utils to ~26.5.0 ([b496bcf](https://github.com/NiGhTTraX/strong-mock/commit/b496bcf1386d1586472f6c15f9a6b8be62dc472c))
60
- * **deps:** update dependency jest-matcher-utils to ~26.6.0 ([7e25d8c](https://github.com/NiGhTTraX/strong-mock/commit/7e25d8c84a19b0f1fa06c6d003d3c0a137b8928b))
61
- * **deps:** update dependency jest-matcher-utils to v27 ([ed3740b](https://github.com/NiGhTTraX/strong-mock/commit/ed3740b47247267f21ce1cc6df2b3cf01df5a019))
62
- * **deps:** update dependency lodash to ~4.17.0 ([8c192bc](https://github.com/NiGhTTraX/strong-mock/commit/8c192bc79df3af4400445949eca307d86aafb8f7))
63
-
64
-
65
- ### build
66
-
67
- * Use node 12 ([d30054a](https://github.com/NiGhTTraX/strong-mock/commit/d30054aa2eee48f612737e3d747022c57694d219))
68
-
69
- ## [6.0.0](https://github.com/NiGhTTraX/strong-mock/compare/v5.0.1...v6.0.0) (2020-06-27)
70
-
71
-
72
- ### ⚠ BREAKING CHANGES
73
-
74
- * Rename `isObjectContaining` to `isObject`
75
-
76
- ### Features
77
-
78
- * Add isNumber matcher ([cc5b0a8](https://github.com/NiGhTTraX/strong-mock/commit/cc5b0a8d125c3632f6c6610381b4fc78b8994f7f))
79
- * Add isString ([6d5980f](https://github.com/NiGhTTraX/strong-mock/commit/6d5980fc82479c6a5bc02068e33a2d5ae9b34fda))
80
- * Add It.isArray ([2359b43](https://github.com/NiGhTTraX/strong-mock/commit/2359b43206aa6bbb20e18295ae332700f0f8a3c8))
81
- * Add verifyAll and resetAll ([eef45e0](https://github.com/NiGhTTraX/strong-mock/commit/eef45e054f6818f629b4fcd17673e6323c025c26))
82
- * Improve error message when setting expectation on nested property ([f1ebabe](https://github.com/NiGhTTraX/strong-mock/commit/f1ebabe29cc5388a04c8183c29b205b38d75cf1a))
83
- * Make matching any object easier ([6011775](https://github.com/NiGhTTraX/strong-mock/commit/60117752e8e0a21ff7df4d2dc2daf05b7b94d0c1))
84
- * Support nested matchers ([c3157b1](https://github.com/NiGhTTraX/strong-mock/commit/c3157b1ce9e6b1761a4f3377885ff195c077f9d0))
85
-
86
-
87
- ### Bug Fixes
88
-
89
- * **deps:** update dependency jest-matcher-utils to ~26.1.0 ([7884b7d](https://github.com/NiGhTTraX/strong-mock/commit/7884b7da0871a7a9e8855a328bd05d97546cf162))
90
- * Make isNumber pretty print consistently with other matchers ([bc5f4f8](https://github.com/NiGhTTraX/strong-mock/commit/bc5f4f86855d9090e82f3f13e323a17ff795ec71))
91
- * Make isString pretty print consistently with other matchers ([3b6d9e8](https://github.com/NiGhTTraX/strong-mock/commit/3b6d9e8b0fff14ca43542d267f1f95878adc3f6b))
92
- * Make mocks pretty-format-able ([73200db](https://github.com/NiGhTTraX/strong-mock/commit/73200dbadc8d5a90b8541fcf7394abd343f6dfd8))
93
-
94
- ### [5.0.1](https://github.com/NiGhTTraX/strong-mock/compare/v5.0.0...v5.0.1) (2020-05-07)
95
-
96
-
97
- ### Bug Fixes
98
-
99
- * Clear unexpected calls on `reset()` ([04493f7](https://github.com/NiGhTTraX/strong-mock/commit/04493f7fa7c0814a4a64aaa4671696df57cb2929))
100
-
101
- ## [5.0.0](https://github.com/NiGhTTraX/strong-mock/compare/v5.0.0-beta.1...v5.0.0) (2020-05-07)
102
-
103
-
104
- ### Features
105
-
106
- * Improve error message for `UnexpectedCalls` ([ff8636c](https://github.com/NiGhTTraX/strong-mock/commit/ff8636c871a45a869d2d509120b40914887f554b))
107
-
108
- ## [5.0.0-beta.1](https://github.com/NiGhTTraX/strong-mock/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2020-05-05)
109
-
110
-
111
- ### Bug Fixes
112
-
113
- * Don't mark toString accesses as unexpected ([20247b6](https://github.com/NiGhTTraX/strong-mock/commit/20247b6799f55fda32d72620e5b8571be323ce99))
114
-
115
- ## [5.0.0-beta.0](https://github.com/NiGhTTraX/strong-mock/compare/v4.1.3...v5.0.0-beta.0) (2020-05-05)
116
-
117
-
118
- ### ⚠ BREAKING CHANGES
119
-
120
- * `verify` used to rely on unexpected calls throwing
121
- when they were made. However, the code under test could `try..catch`
122
- that error and never bubble it up to the test. Unless the test
123
- explicitly checked that the SUT was not in an error state, `verify`
124
- would have not been enough to make sure that everything was correct.
125
- Now it throws if any unexpected calls happened.
126
-
127
- ### Features
128
-
129
- * Record unexpected calls ([a87f612](https://github.com/NiGhTTraX/strong-mock/commit/a87f612df7e702e980f1f3271a8585ac6a280c67))
130
- * Throw on unexpected calls when verifying mock ([f68e2f2](https://github.com/NiGhTTraX/strong-mock/commit/f68e2f231f29a5f97c93011241a1f312e8c6f247))
131
-
132
-
133
- ### Bug Fixes
134
-
135
- * **deps:** update dependency jest-matcher-utils to v26 ([5ae654d](https://github.com/NiGhTTraX/strong-mock/commit/5ae654d31205bc554a7f9edae4dd8a5a45b77cc7))
@@ -1,41 +0,0 @@
1
- import { Expectation, ReturnValue } from '../expectation';
2
- import { CallMap, ExpectationRepository } from './expectation-repository';
3
- import { Property } from '../../proxy';
4
- export declare type CountableExpectation = {
5
- expectation: Expectation;
6
- matchCount: number;
7
- };
8
- export declare abstract class BaseRepository implements ExpectationRepository {
9
- protected readonly expectations: Map<Property, CountableExpectation[]>;
10
- private readonly expectedCallStats;
11
- private readonly unexpectedCallStats;
12
- add(expectation: Expectation): void;
13
- clear(): void;
14
- get(property: Property): ReturnValue;
15
- getAllProperties(): Property[];
16
- getCallStats(): {
17
- expected: CallMap;
18
- unexpected: CallMap;
19
- };
20
- getUnmet(): Expectation[];
21
- /**
22
- * We got a method call that doesn't match any expectation,
23
- * what should we return?
24
- */
25
- protected abstract getValueForUnexpectedCall(property: Property, args: any[]): any;
26
- /**
27
- * We got a property access that doesn't match any expectation,
28
- * what should we return?
29
- */
30
- protected abstract getValueForUnexpectedAccess(property: Property): ReturnValue;
31
- protected abstract consumeExpectation(expectation: CountableExpectation): void;
32
- /**
33
- * Record an expected property access/method call.
34
- */
35
- private recordExpected;
36
- /**
37
- * Record an unexpected property access/method call.
38
- */
39
- private recordUnexpected;
40
- private countAndConsume;
41
- }
@@ -1,10 +0,0 @@
1
- import { BaseRepository, CountableExpectation } from './base-repository';
2
- import { Property } from '../../proxy';
3
- /**
4
- * Throw if no expectation matches.
5
- */
6
- export declare class StrongRepository extends BaseRepository {
7
- protected consumeExpectation(expectation: CountableExpectation): void;
8
- protected getValueForUnexpectedCall(property: Property, args: any[]): never;
9
- protected getValueForUnexpectedAccess(property: Property): never;
10
- }
@@ -1,17 +0,0 @@
1
- import { BaseRepository, CountableExpectation } from './base-repository';
2
- import { Expectation } from '../expectation';
3
- import { ExpectationRepository } from './expectation-repository';
4
- /**
5
- * Always return something, even if no expectations match.
6
- *
7
- * WARNING: this is in development, do not use
8
- */
9
- export declare class WeakRepository extends BaseRepository implements ExpectationRepository {
10
- private repeating;
11
- protected getValueForUnexpectedCall: () => null;
12
- protected getValueForUnexpectedAccess: () => {
13
- value: () => null;
14
- };
15
- protected consumeExpectation(expectation: CountableExpectation): void;
16
- add(expectation: Expectation): void;
17
- }
@@ -1,14 +0,0 @@
1
- import { ReturnValue } from '../expectation/expectation';
2
- import { Mock } from '../mock/mock';
3
- /**
4
- * Return the expectation's return value.
5
- *
6
- * If the value is an error then throw it.
7
- *
8
- * If the value is a promise then resolve/reject it.
9
- */
10
- export declare const returnOrThrow: ({ isError, isPromise, value }: ReturnValue) => any;
11
- /**
12
- * Get a real instance from the mock that you can pass to your code under test.
13
- */
14
- export declare const instance: <T>(mock: T) => T;