File tree Expand file tree Collapse file tree 27 files changed +301
-245
lines changed
Expand file tree Collapse file tree 27 files changed +301
-245
lines changed Original file line number Diff line number Diff line change 11---
2- title : Contains
2+ title : Contains
33---
44
5- ## Assertion: Contains
5+ ## Assertion: Contains
66
7- Asserts that an array contains a given element
7+ Asserts that an array contains a given element
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .contains (needle , haystack );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if array ` haystack ` contains an element with a value of ` needle `
1818
19- Fails if array ` haystack ` does not contain an element with a value of ` needle `
19+ Fails if array ` haystack ` does not contain an element with a value of ` needle `
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` needle ` | the element to find |
2626| ` haystack ` | the array to search |
2727| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Count
2+ title : Count
33---
44
5- ## Assertion: Count
5+ ## Assertion: Count
66
7- Asserts that an array contains a certain number of elements
7+ Asserts that an array contains a certain number of elements
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .count (expected , array );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` array ` contains ` expected ` number of elements
1818
19- Fails if ` array ` does not contain ` expected ` number of elements
19+ Fails if ` array ` does not contain ` expected ` number of elements
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` expected ` | the number of array elements expected |
2626| ` array ` | the array to check the length of |
2727| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Defined
2+ title : Defined
33---
44
5- ## Assertion: Defined
5+ ## Assertion: Defined
66
7- Asserts that a value is defined (any value other than ` undefined ` )
7+ Asserts that a value is defined (any value other than ` undefined ` )
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .defined (expression );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` expression ` does not evaluate to ` undefined `
1818
19- Fails if ` expression ` evaluates to ` undefined `
19+ Fails if ` expression ` evaluates to ` undefined `
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` expression ` | the value to check |
2626| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Does Not Contain
2+ title : Does Not Contain
33---
44
5- ## Assertion: Does Not Contain
5+ ## Assertion: Does Not Contain
66
7- Asserts that an array does not contain a given element
7+ Asserts that an array does not contain a given element
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .doesNotContain (needle , haystack );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if array ` haystack ` does not contain an element with a value of ` needle `
1818
19- Fails if array ` haystack ` contains an element with a value of ` needle `
19+ Fails if array ` haystack ` contains an element with a value of ` needle `
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` needle ` | the element to find |
2626| ` haystack ` | the array to search |
2727| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Does Not Throw
2+ title : Does Not Throw
33---
44
5- ## Assertion: Does Not Throw
5+ ## Assertion: Does Not Throw
66
7- Asserts that an expression does not throw an error/exception
7+ Asserts that an expression does not throw an error/exception
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .doesNotThrow (() => expression );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if calling ` expression ` does not throw an error/exception
1818
19- Fails if calling ` expression ` throws an error/exception
19+ Fails if calling ` expression ` throws an error/exception
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` expression ` | the expression to run |
2626| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Empty
2+ title : Empty
33---
44
5- ## Assertion: Empty
5+ ## Assertion: Empty
66
7- Asserts that an array is empty
7+ Asserts that an array is empty
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .empty (array );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` array ` contains zero elements
1818
19- Fails if ` array ` contains any elements
19+ Fails if ` array ` contains any elements
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` array ` | the array to check |
2626| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Equal
2+ title : Equal
33---
44
5- ## Assertion: Equal
5+ ## Assertion: Equal
66
7- Asserts that two values are equal
7+ Asserts that two values are equal
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .equal (expected , actual );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` actual ` and ` expected ` evaluate to equal values
1818
19- Fails if ` actual ` and ` expected ` do not evaluate to equal values
19+ Fails if ` actual ` and ` expected ` do not evaluate to equal values
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` expected ` | the expected value |
2626| ` actual ` | the actual value |
2727| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : False
2+ title : False
33---
44
5- ## Assertion: False
5+ ## Assertion: False
66
7- Asserts that a given value is equal to ` false `
7+ Asserts that a given value is equal to ` false `
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .false (expression );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` expression ` evaluates to ` false `
1818
19- Fails if ` expression ` does not evaluate to ` false `
19+ Fails if ` expression ` does not evaluate to ` false `
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` expression ` | the value to check |
2626| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Instance Of
2+ title : Instance Of
33---
44
5- ## Assertion: Instance Of
5+ ## Assertion: Instance Of
66
7- Asserts that a value is an instance of a certain type
7+ Asserts that a value is an instance of a certain type
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .instanceOf (type , object );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` object ` 's type matches ` type `
1818
19- Fails if ` object ` 's type does not match ` type `
19+ Fails if ` object ` 's type does not match ` type `
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` type ` | the expected type of the value |
2626| ` expression ` | the value to check |
2727| ` message ` | (optional) message to display on failure |
Original file line number Diff line number Diff line change 11---
2- title : Not Empty
2+ title : Not Empty
33---
44
5- ## Assertion: Not Empty
5+ ## Assertion: Not Empty
66
7- Asserts that an array is not empty
7+ Asserts that an array is not empty
88
9- ### Example
9+ ### Example
1010
11- ``` ts
11+ ``` ts
1212this .assert .notEmpty (array );
13- ```
13+ ```
1414
15- ### Conditions
15+ ### Conditions
1616
1717Passes if ` array ` contains any elements
1818
19- Fails if ` array ` contains zero elements
19+ Fails if ` array ` contains zero elements
2020
21- ### Parameters
21+ ### Parameters
2222
23- | Name | Description |
24- | ---| ---|
23+ | Name | Description |
24+ | ---| ---|
2525| ` array ` | the array to check |
2626| ` message ` | (optional) message to display on failure |
You can’t perform that action at this time.
0 commit comments