unexpected-ts
A typescript friendly wrapper around http://unexpected.js.org, the extensible BDD assertion toolkit
Rational
While it's possible to create typescript typings for unexpected, it's difficult (impossible?) to create extensible typings for the expect function.
There's no point in having typings for an extensible library that aren't extensible!
So instead this is a little wrapper around unexpected that adjusts how it's exported, so that the types are extensible.
How to extend
Because we're using an interface to define unexpected
, and because we're exporting this interface alongside unexpected
,
it becomes possible to add additional overrides.
This approach can be used to add support for custom assertions, or to add support for plugins.
; declare expect.addAssertion"<string> [not] to be fast", ; expect"something", "not to be fast";expect"fast", "to be fast";