clientnode 4.0.1477 → 4.0.1479

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.
@@ -1,4 +1,4 @@
1
- import type { AnyFunction, FirstParameter, FunctionTestTuple, FunctionTestPromiseTuple, FunctionTestPromiseRejectionTuple, TestMatchers as Matchers, TestSymbol, ThenParameter, UnknownFunction } from './type';
1
+ import { AnyFunction, FirstParameter, FunctionTestTuple, FunctionTestPromiseTuple, FunctionTestPromiseRejectionTuple, TestMatchers as Matchers, TestSymbol, ThenParameter, UnknownFunction, FunctionTestAgainstResolvedPromiseTuple, FunctionTestPromiseAgainstResolvedPromiseTuple, FunctionTestPromiseRejectionAgainstResolvedPromiseTuple } from './type';
2
2
  export declare const TEST_DEFINED_SYMBOL: unique symbol;
3
3
  export declare const TEST_THROW_SYMBOL: unique symbol;
4
4
  export declare const TEST_UNDEFINED_SYMBOL: unique symbol;
@@ -25,6 +25,21 @@ export declare const testEach: {
25
25
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestTuple<FunctionType>>): void;
26
26
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestTuple<FunctionType>>): void;
27
27
  };
28
+ /**
29
+ * Tests each given test set (promise resolving to expected value follows by
30
+ * various list of function parameters). It respects function signature to
31
+ * raise compile time errors if given test set does not match given function
32
+ * signature.
33
+ * @param functionName - Function description to test.
34
+ * @param callback - Function reference to test.
35
+ * @param functionTestTuple - Additional arrays of test sets to test given
36
+ * function again.
37
+ */
38
+ export declare const testEachAgainstResolvedPromise: {
39
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestAgainstResolvedPromiseTuple<FunctionType>>): void;
40
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestAgainstResolvedPromiseTuple<FunctionType>>): void;
41
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestAgainstResolvedPromiseTuple<FunctionType>>): void;
42
+ };
28
43
  /**
29
44
  * Tests each given test set (expected value follows by various list of
30
45
  * function parameters). It respects function signature to raise compile time
@@ -34,7 +49,7 @@ export declare const testEach: {
34
49
  * @param functionTestTuple - Additional arrays of test sets to test given
35
50
  * function again.
36
51
  */
37
- export declare const testEachPromise: {
52
+ export declare const testEachResolvedPromise: {
38
53
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseTuple<FunctionType>>): void;
39
54
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseTuple<FunctionType>>): void;
40
55
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseTuple<FunctionType>>): void;
@@ -48,11 +63,35 @@ export declare const testEachPromise: {
48
63
  * @param functionTestTuple - Additional arrays of test sets to test given
49
64
  * function again.
50
65
  */
51
- export declare const testEachPromiseRejection: {
66
+ export declare const testEachResolvedPromiseAgainstResolvedPromise: <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseAgainstResolvedPromiseTuple<FunctionType>>) => void;
67
+ /**
68
+ * Tests each given test set (expected value follows by various list of
69
+ * function parameters). It respects function signature to raise compile time
70
+ * errors if given test set does not match given function signature.
71
+ * @param functionName - Function description to test.
72
+ * @param callback - Function reference to test.
73
+ * @param functionTestTuple - Additional arrays of test sets to test given
74
+ * function again.
75
+ */
76
+ export declare const testEachRejectedPromise: {
52
77
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionTuple<FunctionType>>): void;
53
78
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionTuple<FunctionType>>): void;
54
79
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionTuple<FunctionType>>): void;
55
80
  };
81
+ /**
82
+ * Tests each given test set (expected value follows by various list of
83
+ * function parameters). It respects function signature to raise compile time
84
+ * errors if given test set does not match given function signature.
85
+ * @param functionName - Function description to test.
86
+ * @param callback - Function reference to test.
87
+ * @param functionTestTuple - Additional arrays of test sets to test given
88
+ * function again.
89
+ */
90
+ export declare const testEachRejectedPromiseAgainstResolvedPromise: {
91
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionAgainstResolvedPromiseTuple<FunctionType>>): void;
92
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionAgainstResolvedPromiseTuple<FunctionType>>): void;
93
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, ...functionTestTuple: Array<FunctionTestPromiseRejectionAgainstResolvedPromiseTuple<FunctionType>>): void;
94
+ };
56
95
  /**
57
96
  * Tests each given single parameter against same given expected value. It
58
97
  * respects function signature to raise compile time errors if given test set
@@ -76,11 +115,26 @@ export declare const testEachSingleParameterAgainstSameExpectation: {
76
115
  * @param expected - Value to check each function call return value against.
77
116
  * @param parameters - Additional first parameters to test given function with.
78
117
  */
79
- export declare const testEachSingleParameterAgainstSamePromisedExpectation: {
118
+ export declare const testEachResolvedPromiseWithSingleParameterAgainstSameExpectation: {
80
119
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
81
120
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
82
121
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
83
122
  };
123
+ /**
124
+ * Tests each given single parameter against same given promises resolving to
125
+ * expected value. It respects function signature to raise compile time errors
126
+ * if given test set does not match given function signature.
127
+ * @param functionName - Function description to test.
128
+ * @param callback - Function reference to test.
129
+ * @param expected - Promise resolving to value to check each function call
130
+ * return value against.
131
+ * @param parameters - Additional first parameters to test given function with.
132
+ */
133
+ export declare const testEachResolvedPromiseWithSingleParameterAgainstSameResolvedPromise: {
134
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
135
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
136
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...parameters: Array<FirstParameter<FunctionType>>): void;
137
+ };
84
138
  /**
85
139
  * Tests each given single parameter against same given expected value. It
86
140
  * respects function signature to raise compile time errors if given test set
@@ -90,11 +144,25 @@ export declare const testEachSingleParameterAgainstSamePromisedExpectation: {
90
144
  * @param expected - Value to check each function call return value against.
91
145
  * @param parameters - Additional first parameters to test given function with.
92
146
  */
93
- export declare const testEachSingleParameterAgainstSameRejectedExpectation: {
147
+ export declare const testEachRejectedPromiseWithSingleParameterAgainstSameExpectation: {
94
148
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...parameters: Array<FirstParameter<FunctionType>>): void;
95
149
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...parameters: Array<FirstParameter<FunctionType>>): void;
96
150
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...parameters: Array<FirstParameter<FunctionType>>): void;
97
151
  };
152
+ /**
153
+ * Tests each given single parameter against same given expected value. It
154
+ * respects function signature to raise compile time errors if given test set
155
+ * does not match given function signature.
156
+ * @param functionName - Function description to test.
157
+ * @param callback - Function reference to test.
158
+ * @param expected - Value to check each function call return value against.
159
+ * @param parameters - Additional first parameters to test given function with.
160
+ */
161
+ export declare const testEachRejectedPromiseWithSingleParameterAgainstSameResolvedPromise: {
162
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...parameters: Array<FirstParameter<FunctionType>>): void;
163
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...parameters: Array<FirstParameter<FunctionType>>): void;
164
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...parameters: Array<FirstParameter<FunctionType>>): void;
165
+ };
98
166
  /**
99
167
  * Tests each given test set (various list of function parameters) against same
100
168
  * given expected value. It respects function signature to raise compile time
@@ -120,11 +188,28 @@ export declare const testEachAgainstSameExpectation: {
120
188
  * @param functionParameters - Additional lists of parameters to test given
121
189
  * function again.
122
190
  */
123
- export declare const testEachPromiseAgainstSameExpectation: {
191
+ export declare const testEachResolvedPromiseAgainstSameExpectation: {
124
192
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
125
193
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
126
194
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: TestSymbol | ThenParameter<ReturnType<FunctionType>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
127
195
  };
196
+ /**
197
+ * Tests each given test set (various list of function parameters) against same
198
+ * given promise resolving expected value. It respects function signature to
199
+ * raise compile time errors if given test set does not match given function
200
+ * signature.
201
+ * @param functionName - Function description to test.
202
+ * @param callback - Function reference to test.
203
+ * @param expected - Promise resolving to value to check each function call
204
+ * return value against.
205
+ * @param functionParameters - Additional lists of parameters to test given
206
+ * function again.
207
+ */
208
+ export declare const testEachResolvedPromiseAgainstSameResolvedPromise: {
209
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
210
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
211
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<TestSymbol | ThenParameter<ReturnType<FunctionType>>>, ...functionParameters: Array<Parameters<FunctionType>>): void;
212
+ };
128
213
  /**
129
214
  * Tests each given test set (various list of function parameters) against same
130
215
  * given expected value. It respects function signature to raise compile time
@@ -135,9 +220,26 @@ export declare const testEachPromiseAgainstSameExpectation: {
135
220
  * @param functionParameters - Additional lists of parameters to test given
136
221
  * function again.
137
222
  */
138
- export declare const testEachPromiseRejectionAgainstSameExpectation: {
223
+ export declare const testEachRejectedPromiseAgainstSameExpectation: {
139
224
  <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...functionParameters: Array<Parameters<FunctionType>>): void;
140
225
  only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...functionParameters: Array<Parameters<FunctionType>>): void;
141
226
  skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Error | TestSymbol, ...functionParameters: Array<Parameters<FunctionType>>): void;
142
227
  };
228
+ /**
229
+ * Tests each given test set (various list of function parameters) against same
230
+ * given promise resolving expected value. It respects function signature to
231
+ * raise compile time errors if given test set does not match given function
232
+ * signature.
233
+ * @param functionName - Function description to test.
234
+ * @param callback - Function reference to test.
235
+ * @param expected - Promise resolving to value to check each function call
236
+ * return value against.
237
+ * @param functionParameters - Additional lists of parameters to test given
238
+ * function again.
239
+ */
240
+ export declare const testEachRejectedPromiseAgainstSameResolvedPromise: {
241
+ <FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...functionParameters: Array<Parameters<FunctionType>>): void;
242
+ only<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...functionParameters: Array<Parameters<FunctionType>>): void;
243
+ skip<FunctionType extends AnyFunction = UnknownFunction>(functionName: string, callback: FunctionType, expected: Promise<Error | TestSymbol>, ...functionParameters: Array<Parameters<FunctionType>>): void;
244
+ };
143
245
  export default testEach;