Test an array to end with a specific value. The value is tested by identity, not structure. @param searchElement - The value that should be the end of the array.
(searchElement: T)
| 69 | @param searchElement - The value that should be the end of the array. |
| 70 | */ |
| 71 | endsWith(searchElement: T): this { |
| 72 | return this.addValidator({ |
| 73 | message: (value, label) => `Expected ${label} to end with \`${searchElement}\`, got \`${value.at(-1)}\``, |
| 74 | validator: value => value.at(-1) === searchElement, |
| 75 | }); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | Test an array to include all the provided elements. The values are tested by identity, not structure. |
no test coverage detected