Skip to content

Commit b8be463

Browse files
added to satisfy validation to verify user-defined expectation provided as predicate (#26)
1 parent e069ac4 commit b8be463

File tree

6 files changed

+453
-332
lines changed

6 files changed

+453
-332
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
1212

1313
:pencil: - chore
1414

15+
## 1.3.0
16+
- :rocket: added `to satisfy` validation to verify user-defined expectation provided as predicate
17+
```Gherkin
18+
Then I expect '$value' to satisfy '$either(1, 2)'
19+
```
20+
where `$either` is a function
21+
```typescript
22+
function either(...expected) {
23+
return function (actual) {
24+
return expected.includes(actual)
25+
}
26+
}
27+
```
28+
1529
## 1.2.1
1630
- :rocket: added capability to pass `softly` prefix and throw `SoftAssertionError`
1731

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This library supports a variety of validation types, which can all be negated by
2929
- **`match`**: Validates if a string matches a regular expression.
3030
- **`have type`**: Checks the type of a variable (e.g., `string`, `number`, `boolean`).
3131
- **`match schema`**: Validates data against an [ajv](https://www.npmjs.com/package/ajv) schema, which is useful for complex object validation.
32+
- **`satisfy`**: verify user-defined expectation provided as predicate
3233

3334
## Test
3435

0 commit comments

Comments
 (0)