Skip to content

Commit 58bdbad

Browse files
refactor(TestingTests): add generic variable Value to the toBe() and toEqual() method, change the value description
1 parent 10be25d commit 58bdbad

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/lib/testing-tests.class.ts

+29-29
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export class TestingTests extends TestingCore {
1717
* @param execute Whether or not to execute the spec.
1818
* @returns The return value is an instance of a `TestingTests`.
1919
*/
20-
public toBe(
20+
public toBe<Value>(
2121
expectation: string,
22-
value: any,
22+
value: Value,
2323
expected: any,
2424
execute?: boolean
2525
): this {
@@ -52,7 +52,7 @@ export class TestingTests extends TestingCore {
5252
/**
5353
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be a `bigint` type
5454
* on the `expected` of `true`.
55-
* @param value Any kind of value to check.
55+
* @param value The value of any type to check.
5656
* @param execute Whether or not to execute the spec, by default it's set to `true`.
5757
* @param expectation The message for the karma, which by default is set to `The value must be a bigint type`.
5858
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -71,7 +71,7 @@ export class TestingTests extends TestingCore {
7171
/**
7272
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be of a `boolean` type
7373
* on the `expected` of `true`.
74-
* @param value Any kind of value to check.
74+
* @param value The value of any type to check.
7575
* @param execute Whether or not to execute the spec, by default it's set to `true`.
7676
* @param expectation The message for the karma, which by default is set to `The value must be of a boolean type`.
7777
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -90,7 +90,7 @@ export class TestingTests extends TestingCore {
9090
/**
9191
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be a `class`
9292
* on the `expected` of `true`.
93-
* @param value Any kind of value to check.
93+
* @param value The value of any type to check.
9494
* @param execute Whether or not to execute the spec, by default it's set to `true`.
9595
* @param expectation The message for the karma, which by default is set to `The value must be a class`.
9696
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -111,7 +111,7 @@ export class TestingTests extends TestingCore {
111111
/**
112112
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of an `Array`
113113
* on the `expected` of `true`.
114-
* @param value Any kind of value to check.
114+
* @param value The value of any type to check.
115115
* @param execute Whether or not to execute the spec, by default it's set to `true`.
116116
* @param expectation The message for the karma, which by default is set to
117117
* `The value must be an instance of an Array`.
@@ -131,7 +131,7 @@ export class TestingTests extends TestingCore {
131131
/**
132132
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `Boolean`
133133
* on the `expected` of `true`.
134-
* @param value Any kind of value to check.
134+
* @param value The value of any type to check.
135135
* @param execute Whether or not to execute the spec, by default it's set to `true`.
136136
* @param expectation The message for the karma, which by default is set to
137137
* `The value must be an instance of Boolean`.
@@ -151,7 +151,7 @@ export class TestingTests extends TestingCore {
151151
/**
152152
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `Date`
153153
* on the `expected` of `true`.
154-
* @param value Any kind of value to check.
154+
* @param value The value of any type to check.
155155
* @param execute Whether or not to execute the spec, by default it's set to `true`.
156156
* @param expectation The message for the karma, which by default is set to
157157
* `The value must be an instance of Date`.
@@ -171,7 +171,7 @@ export class TestingTests extends TestingCore {
171171
/**
172172
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of an `Error`
173173
* on the `expected` of `true`.
174-
* @param value Any kind of value to check.
174+
* @param value The value of any type to check.
175175
* @param execute Whether or not to execute the spec, by default it's set to `true`.
176176
* @param expectation The message for the karma, which by default is set to
177177
* `The value must be an instance of an Error`.
@@ -191,7 +191,7 @@ export class TestingTests extends TestingCore {
191191
/**
192192
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of a `Function`
193193
* on the `expected` of `true`.
194-
* @param value Any kind of value to check.
194+
* @param value The value of any type to check.
195195
* @param execute Whether or not to execute the spec, by default it's set to `true`.
196196
* @param expectation The message for the karma, which by default is set to
197197
* `The value must be an instance of a Function`.
@@ -211,7 +211,7 @@ export class TestingTests extends TestingCore {
211211
/**
212212
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of a `Map`
213213
* on the `expected` of `true`.
214-
* @param value Any kind of value to check.
214+
* @param value The value of any type to check.
215215
* @param execute Whether or not to execute the spec, by default it's set to `true`.
216216
* @param expectation The message for the karma, which by default is set to
217217
* `The value must be an instance of a Map.
@@ -231,7 +231,7 @@ export class TestingTests extends TestingCore {
231231
/**
232232
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of a `Number`
233233
* on the `expected` of `true`.
234-
* @param value Any kind of value to check.
234+
* @param value The value of any type to check.
235235
* @param execute Whether or not to execute the spec, by default it's set to `true`.
236236
* @param expectation The message for the karma, which by default is set to
237237
* `The value must be an instance of a Number.
@@ -251,7 +251,7 @@ export class TestingTests extends TestingCore {
251251
/**
252252
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of an `Object`
253253
* on the `expected` of `true`.
254-
* @param value Any kind of value to check.
254+
* @param value The value of any type to check.
255255
* @param execute Whether or not to execute the spec, by default it's set to `true`.
256256
* @param expectation The message for the karma, which by default is set to
257257
* `The value must be an instance of an Object.
@@ -271,7 +271,7 @@ export class TestingTests extends TestingCore {
271271
/**
272272
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `Promise`
273273
* on the `expected` of `true`.
274-
* @param value Any kind of value to check.
274+
* @param value The value of any type to check.
275275
* @param execute Whether or not to execute the spec, by default it's set to `true`.
276276
* @param expectation The message for the karma, which by default is set to
277277
* `The value must be an instance of Promise`.
@@ -292,7 +292,7 @@ export class TestingTests extends TestingCore {
292292
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `RangeError`
293293
* on the `expected` state.
294294
* by default of `true`.
295-
* @param value Any kind of value to check.
295+
* @param value The value of any type to check.
296296
* @param execute Whether or not to execute the spec.
297297
* @param expectation The message for the karma, which by default is set to
298298
* `The value must be an instance of RangeError.
@@ -312,7 +312,7 @@ export class TestingTests extends TestingCore {
312312
/**
313313
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `ReferenceError`
314314
* on the `expected` of `true`.
315-
* @param value Any kind of value to check.
315+
* @param value The value of any type to check.
316316
* @param execute Whether or not to execute the spec, by default it's set to `true`.
317317
* @param expectation The message for the karma, which by default is set to
318318
* `The value must be an instance of ReferenceError.
@@ -332,7 +332,7 @@ export class TestingTests extends TestingCore {
332332
/**
333333
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `RegExp`
334334
* on the `expected` of `true`.
335-
* @param value Any kind of value to check.
335+
* @param value The value of any type to check.
336336
* @param execute Whether or not to execute the spec, by default it's set to `true`.
337337
* @param expectation The message for the karma, which by default is set to
338338
* `The value must be an instance of RegExp.
@@ -352,7 +352,7 @@ export class TestingTests extends TestingCore {
352352
/**
353353
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `Set`
354354
* on the `expected` of `true`.
355-
* @param value Any kind of value to check.
355+
* @param value The value of any type to check.
356356
* @param execute Whether or not to execute the spec, by default it's set to `true`.
357357
* @param expectation The message for the karma, which by default is set to
358358
* `The value must be an instance of Set.
@@ -372,7 +372,7 @@ export class TestingTests extends TestingCore {
372372
/**
373373
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `Storage`
374374
* on the `expected` of `true`.
375-
* @param value Any kind of value to check.
375+
* @param value The value of any type to check.
376376
* @param execute Whether or not to execute the spec, by default it's set to `true`.
377377
* @param expectation The message for the karma, which by default is set to
378378
* `The value must be an instance of Storage.
@@ -392,7 +392,7 @@ export class TestingTests extends TestingCore {
392392
/**
393393
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of a `String`
394394
* on the `expected` of `true`.
395-
* @param value Any kind of value to check.
395+
* @param value The value of any type to check.
396396
* @param expectation The message for the karma, which by default is set to
397397
* `The value must be an instance of a String.
398398
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -413,7 +413,7 @@ export class TestingTests extends TestingCore {
413413
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `SyntaxError`
414414
* on the `expected` of `true`.
415415
* by default of `true`.
416-
* @param value Any kind of value to check.
416+
* @param value The value of any type to check.
417417
* @param execute Whether or not to execute the spec, by default it's set to `true`.
418418
* @param expectation The message for the karma, which by default is set to
419419
* `The value must be an instance of SyntaxError.
@@ -433,7 +433,7 @@ export class TestingTests extends TestingCore {
433433
/**
434434
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `TypeError`
435435
* on the `expected` of `true`.
436-
* @param value Any kind of value to check.
436+
* @param value The value of any type to check.
437437
* @param execute Whether or not to execute the spec, by default it's set to `true`.
438438
* @param expectation The message for the karma, which by default is set to
439439
* `The value must be an instance of TypeError.
@@ -453,7 +453,7 @@ export class TestingTests extends TestingCore {
453453
/**
454454
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of `URIError`
455455
* on the `expected` of `true`.
456-
* @param value Any kind of value to check.
456+
* @param value The value of any type to check.
457457
* @param execute Whether or not to execute the spec, by default it's set to `true`.
458458
* @param expectation The message for the karma, which by default is set to
459459
* `The value must be an instance of URIError.
@@ -473,7 +473,7 @@ export class TestingTests extends TestingCore {
473473
/**
474474
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be an instance of a `WeakSet`
475475
* on the `expected` of `true`.
476-
* @param value Any kind of value to check.
476+
* @param value The value of any type to check.
477477
* @param execute Whether or not to execute the spec, by default it's set to `true`.
478478
* @param expectation The message for the karma, which by default is set to
479479
* `The value must be an instance of a WeakSet.
@@ -493,7 +493,7 @@ export class TestingTests extends TestingCore {
493493

494494
/**
495495
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be `null` on the `expected` of `true`.
496-
* @param value Any kind of value to check.
496+
* @param value The value of any type to check.
497497
* @param execute Whether or not to execute the spec, by default it's set to `true`.
498498
* @param expectation The message for the karma, which by default is set to `The value must be \`null\``.
499499
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -512,7 +512,7 @@ export class TestingTests extends TestingCore {
512512
/**
513513
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be of a `number` type
514514
* on the `expected` of `true`.
515-
* @param value Any kind of value to check.
515+
* @param value The value of any type to check.
516516
* @param execute Whether or not to execute the spec, by default it's set to `true`.
517517
* @param expectation The message for the karma, which by default is set to `The value must be of a \`number\` type`.
518518
* @param expected Expects the result of the expectation must be `true` or `false`, by default it's `true`.
@@ -531,7 +531,7 @@ export class TestingTests extends TestingCore {
531531
/**
532532
* Executes the spec on a state `true` from the `execute` expecting the provided `value` to be of a `string` type
533533
* on the `expected` of `true`.
534-
* @param value Any kind of value to check.
534+
* @param value The value of any type to check.
535535
* @param execute Whether or not to execute the spec, by default it's set to `true`.
536536
* @param expectation The message for the karma, which by default is set to `The value must be of a \`string\` type`.
537537
* @param expected The value can be `true` or `false`, by default it's `true`.
@@ -558,9 +558,9 @@ export class TestingTests extends TestingCore {
558558
* @param execute Whether or not to execute the spec.
559559
* @returns The return value is an instance of a `TestingTests`.
560560
*/
561-
public toEqual(
561+
public toEqual<Value>(
562562
expectation: string,
563-
value: any,
563+
value: Value,
564564
expected: any,
565565
execute?: boolean
566566
): this {

0 commit comments

Comments
 (0)