You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-34
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ npm i --save @angular-package/testing
91
91
92
92
## Instance of
93
93
94
-
Possible names of javascript objects that can be checked by the [`instanceof`](js-instanceof) operator.
94
+
Possible names of javascript objects that can be checked by the [`instanceof`][js-instanceof] operator.
95
95
96
96
```typescript
97
97
const value:any=newObject({});
@@ -139,6 +139,8 @@ value instanceof WeakSet;
139
139
140
140
Simple `class` to support testing.
141
141
142
+
> Methods prefixed with the `toBe` aren't working with the `beforeEach()` function of jasmine.
143
+
142
144
**Static methods:**
143
145
144
146
| Testing. | Description |
@@ -426,7 +428,7 @@ public describe(
426
428
427
429
| Name: type | Description |
428
430
| :---------------------------- | :---------- |
429
-
|`description: string`| "Textual description of the group" with an optional defined prefix indicating its unique number inside the describe |
431
+
|`description: string`| "Textual description of the group" with an optional its unique number inside the describe when adding `[counter]`|
430
432
|`specDefinitions: () => void`| "Function for Jasmine to invoke that will define inner suites a specs" |
431
433
|`execute: boolean`| A [`boolean`][js-boolean] type value to decide whether or not execute defined [`describe()`][jasmine-describe] of jasmine function |
432
434
@@ -518,9 +520,9 @@ testing.describe(
518
520
Executes the spec on a state `true` from the `execute` expecting the provided `value` to be the given `expected` value.
519
521
520
522
```typescript
521
-
publictoBe(
523
+
publictoBe<Value>(
522
524
expectation: string,
523
-
value: any,
525
+
value: Value,
524
526
expected: any,
525
527
execute?:boolean
526
528
): this {
@@ -534,8 +536,8 @@ public toBe(
534
536
| Name: type | Description |
535
537
| :-------------------- | :---------- |
536
538
|`expectation: string`| "Textual description of what this spec is checking" with an optional its unique number when adding `[counter]`|
537
-
|`value: any`| The value of any type passed to the `expect()` function of jasmine |
538
-
|`expected: any`| The value of any type passed to the `toBe()` method of jasmine |
539
+
|`value: Value`| The value of any type passed to the `expect()` function of jasmine |
540
+
|`expected: any`| The value of any type passed to the `toBe()` method of `jasmine.Matchers`|
539
541
|`execute?: boolean`| Whether or not to execute the spec |
540
542
541
543
**Returns:**
@@ -588,7 +590,7 @@ public toBeBigInt<Value>(
588
590
589
591
| Name: type | Description |
590
592
| :-------------------- | :---------- |
591
-
|`value: Value`|Any kind of value to check |
593
+
|`value: Value`|The value of any type to check |
592
594
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
593
595
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be a bigint type`|
594
596
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -637,7 +639,7 @@ public toBeBooleanType<Value>(
637
639
638
640
| Name: type | Description |
639
641
| :-------------------- | :---------- |
640
-
|`value: Value`|Any kind of value to check |
642
+
|`value: Value`|The value of any type to check |
641
643
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
642
644
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be of a boolean type`|
643
645
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -684,7 +686,7 @@ public toBeClass<Value>(
684
686
685
687
| Name: type | Description |
686
688
| :-------------------- | :---------- |
687
-
|`value: Value`|Any kind of value to check |
689
+
|`value: Value`|The value of any type to check |
688
690
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
689
691
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be a class`|
690
692
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -734,7 +736,7 @@ public toBeInstanceOfArray<Value>(
734
736
735
737
| Name: type | Description |
736
738
| :-------------------- | :---------- |
737
-
|`value: Value`|Any kind of value to check |
739
+
|`value: Value`|The value of any type to check |
738
740
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
739
741
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of an Array`|
740
742
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -781,7 +783,7 @@ public toBeInstanceOfBoolean<Value>(
781
783
782
784
| Name: type | Description |
783
785
| :-------------------- | :---------- |
784
-
|`value: Value`|Any kind of value to check |
786
+
|`value: Value`|The value of any type to check |
785
787
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
786
788
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of an Boolean`|
787
789
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -828,7 +830,7 @@ public toBeInstanceOfDate<Value>(
828
830
829
831
| Name: type | Description |
830
832
| :-------------------- | :---------- |
831
-
|`value: Value`|Any kind of value to check |
833
+
|`value: Value`|The value of any type to check |
832
834
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
833
835
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of Date`|
834
836
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -875,7 +877,7 @@ public toBeInstanceOfError<Value>(
875
877
876
878
| Name: type | Description |
877
879
| :-------------------- | :---------- |
878
-
|`value: Value`|Any kind of value to check |
880
+
|`value: Value`|The value of any type to check |
879
881
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
880
882
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of an Error`|
881
883
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -928,7 +930,7 @@ public toBeInstanceOfFunction<Value>(
928
930
929
931
| Name: type | Description |
930
932
| :-------------------- | :---------- |
931
-
|`value: Value`|Any kind of value to check |
933
+
|`value: Value`|The value of any type to check |
932
934
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
933
935
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of a Function`|
934
936
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -975,7 +977,7 @@ public toBeInstanceOfMap<Value>(
975
977
976
978
| Name: type | Description |
977
979
| :-------------------- | :---------- |
978
-
|`value: Value`|Any kind of value to check |
980
+
|`value: Value`|The value of any type to check |
979
981
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
980
982
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of a Map`|
981
983
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1022,7 +1024,7 @@ public toBeInstanceOfNumber<Value>(
1022
1024
1023
1025
| Name: type | Description |
1024
1026
| :-------------------- | :---------- |
1025
-
|`value: Value`|Any kind of value to check |
1027
+
|`value: Value`|The value of any type to check |
1026
1028
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1027
1029
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of a Number`|
1028
1030
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1071,7 +1073,7 @@ public toBeInstanceOfObject<Value>(
1071
1073
1072
1074
| Name: type | Description |
1073
1075
| :-------------------- | :---------- |
1074
-
|`value: Value`|Any kind of value to check |
1076
+
|`value: Value`|The value of any type to check |
1075
1077
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1076
1078
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of an Object`|
1077
1079
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1122,7 +1124,7 @@ public toBeInstanceOfPromise<Value>(
1122
1124
1123
1125
| Name: type | Description |
1124
1126
| :-------------------- | :---------- |
1125
-
|`value: Value`|Any kind of value to check |
1127
+
|`value: Value`|The value of any type to check |
1126
1128
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1127
1129
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of Promise`|
1128
1130
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1175,7 +1177,7 @@ public toBeInstanceOfRangeError<Value>(
1175
1177
1176
1178
| Name: type | Description |
1177
1179
| :-------------------- | :---------- |
1178
-
|`value: Value`|Any kind of value to check |
1180
+
|`value: Value`|The value of any type to check |
1179
1181
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1180
1182
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of RangeError`|
1181
1183
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1228,7 +1230,7 @@ public toBeInstanceOfReferenceError<Value>(
1228
1230
1229
1231
| Name: type | Description |
1230
1232
| :-------------------- | :---------- |
1231
-
|`value: Value`|Any kind of value to check |
1233
+
|`value: Value`|The value of any type to check |
1232
1234
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1233
1235
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of ReferenceError`|
1234
1236
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1281,7 +1283,7 @@ public toBeInstanceOfRegExp<Value>(
1281
1283
1282
1284
| Name: type | Description |
1283
1285
| :-------------------- | :---------- |
1284
-
|`value: Value`|Any kind of value to check |
1286
+
|`value: Value`|The value of any type to check |
1285
1287
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1286
1288
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of RegExp`|
1287
1289
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1330,7 +1332,7 @@ public toBeInstanceOfSet<Value>(
1330
1332
1331
1333
| Name: type | Description |
1332
1334
| :-------------------- | :---------- |
1333
-
|`value: Value`|Any kind of value to check |
1335
+
|`value: Value`|The value of any type to check |
1334
1336
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1335
1337
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of Set`|
1336
1338
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1377,7 +1379,7 @@ public toBeInstanceOfStorage<Value>(
1377
1379
1378
1380
| Name: type | Description |
1379
1381
| :-------------------- | :---------- |
1380
-
|`value: Value`|Any kind of value to check |
1382
+
|`value: Value`|The value of any type to check |
1381
1383
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1382
1384
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of Storage`|
1383
1385
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1424,7 +1426,7 @@ public toBeInstanceOfString<Value>(
1424
1426
1425
1427
| Name: type | Description |
1426
1428
| :-------------------- | :---------- |
1427
-
|`value: Value`|Any kind of value to check |
1429
+
|`value: Value`|The value of any type to check |
1428
1430
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1429
1431
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of a String`|
1430
1432
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1471,7 +1473,7 @@ public toBeInstanceOfSyntaxError<Value>(
1471
1473
1472
1474
| Name: type | Description |
1473
1475
| :-------------------- | :---------- |
1474
-
|`value: Value`|Any kind of value to check |
1476
+
|`value: Value`|The value of any type to check |
1475
1477
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1476
1478
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of SyntaxError`|
1477
1479
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1524,7 +1526,7 @@ public toBeInstanceOfSyntaxError<Value>(
1524
1526
1525
1527
| Name: type | Description |
1526
1528
| :-------------------- | :---------- |
1527
-
|`value: Value`|Any kind of value to check |
1529
+
|`value: Value`|The value of any type to check |
1528
1530
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1529
1531
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of SyntaxError`|
1530
1532
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1577,7 +1579,7 @@ public toBeInstanceOfURIError<Value>(
1577
1579
1578
1580
| Name: type | Description |
1579
1581
| :-------------------- | :---------- |
1580
-
|`value: Value`|Any kind of value to check |
1582
+
|`value: Value`|The value of any type to check |
1581
1583
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1582
1584
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of URIError`|
1583
1585
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1630,7 +1632,7 @@ public toBeInstanceOfWeakSet<Value>(
1630
1632
1631
1633
| Name: type | Description |
1632
1634
| :-------------------- | :---------- |
1633
-
|`value: Value`|Any kind of value to check |
1635
+
|`value: Value`|The value of any type to check |
1634
1636
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1635
1637
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be an instance of WeakSet`|
1636
1638
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1677,7 +1679,7 @@ public toBeNull<Value>(
1677
1679
1678
1680
| Name: type | Description |
1679
1681
| :-------------------- | :---------- |
1680
-
|`value: Value`|Any kind of value to check |
1682
+
|`value: Value`|The value of any type to check |
1681
1683
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1682
1684
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be null`|
1683
1685
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1724,7 +1726,7 @@ public toBeNumberType<Value>(
1724
1726
1725
1727
| Name: type | Description |
1726
1728
| :-------------------- | :---------- |
1727
-
|`value: Value`|Any kind of value to check |
1729
+
|`value: Value`|The value of any type to check |
1728
1730
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1729
1731
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be of a number type`|
1730
1732
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1771,7 +1773,7 @@ public toBeStringType<Value>(
1771
1773
1772
1774
| Name: type | Description |
1773
1775
| :-------------------- | :---------- |
1774
-
|`value: Value`|Any kind of value to check |
1776
+
|`value: Value`|The value of any type to check |
1775
1777
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
1776
1778
|`expectation: string`| The message for the [karma][karma], which by default is set to `The value must be of a string type`|
1777
1779
|`expected: boolean`| Expects the result of the expectation must be `true` or `false`, by default it's `true`|
@@ -1805,9 +1807,9 @@ Executes the spec on a state `true` from the `execute` expecting the provided `v
1805
1807
> "Expect the actual `value` to be equal to the `expected`, using deep equality comparison."
1806
1808
1807
1809
```typescript
1808
-
publictoEqual(
1810
+
publictoEqual<Value>(
1809
1811
expectation: string,
1810
-
value: any,
1812
+
value: Value,
1811
1813
expected: any,
1812
1814
execute?:boolean
1813
1815
): this {
@@ -1822,7 +1824,7 @@ public toEqual(
1822
1824
| :-------------------- | :---------- |
1823
1825
|`expectation: string`| "Textual description of what this spec is checking" with an optional its unique number when adding `[counter]`|
1824
1826
|`value: Value`| The value of any type passed to the [`expect()`][jasmine-expect] function of jasmine |
1825
-
|`expected: boolean`| The value of any type passed to the `toEqual()` method of jasmine. "The expected value to compare against." |
1827
+
|`expected: boolean`| The value of any type passed to the `toEqual()` method of `jasmine.Matchers`. "The expected value to compare against." |
1826
1828
|`execute: boolean`| Whether or not to execute the spec, by default it's set to `true`|
0 commit comments