@bemoje/expected-got
Creates an error-message string with ANSI-colors to make it easy to spot in the console.
Version
Travis CI
Dependencies
Stats
Donate
Installation
npm install @bemoje/expected-gotnpm install --save @bemoje/expected-gotnpm install --save-dev @bemoje/expected-got
Usage
const shouldBeString = 75const shouldBeNumberOrRegExp = 'asd' //=> 'Expected String, got Number' //=> 'Expected Number, RegExp, got String'
Tests
Uses Jest to test module functionality. Run tests to get coverage details.
npm run test
API
expectedGot
Creates an error-message string with ANSI-colors to make it easy to spot in the console.
Parameters
-
constructor
function The expected type's constructor -
value
any The value argued
Returns
string The error message string (ANSI-formatted).