Skip to content

Commit

Permalink
tested some third-party assertion libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mindplay-dk committed Apr 7, 2022
1 parent 01c4366 commit 684c2cf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,14 @@ type PredicatesToAssertions<T> = RemoveNevers<{
/**
* Generates test-methods from a map of simple assertion functions.
*
* Works with predicates libraries such as `validator`, `is`, etc.
* Works with predicate libraries - for example:
*
* TODO check compatibility with the following:
* https://www.npmjs.com/package/validator
* https://www.npmjs.com/package/check-types
* https://www.npmjs.com/package/chai
* https://www.npmjs.com/package/is
* https://www.npmjs.com/package/is-what
* https://www.npmjs.com/package/typed-assert
* https://www.npmjs.com/package/validator √ works (requires @types/validator)
* https://www.npmjs.com/package/is ~ works for predicates only (requires @types/is)
* https://www.npmjs.com/package/check-types ~ works for predicates only (requires @types/check-types)
* https://www.npmjs.com/package/is-what ~ works, but no support for type-guards
* https://www.npmjs.com/package/chai × chai throws errors (not predicates)
* https://www.npmjs.com/package/typed-assert × assertion functions (not predicates)
*/
export function createAssertions<T>(obj: T): PredicatesToAssertions<T> {
const entries = Object.entries(obj).map(([label, assert]) => [
Expand Down

0 comments on commit 684c2cf

Please sign in to comment.