@joegesualdo/assert
v0.0.1
Published
Explicity set expectations; fail if those expectations are not met.
Downloads
6
Readme
assert
Explicity set expectations; fail if those expectations are not met.
Install
$ npm install --save @joegesualdo/assert-js
Usage
import assert from ('@joegesualdo/assert')
let testStr = 'hello world';
assert.type(testStr, 'boolean');
//=> throws `TypeError`
Test
$ npm test
API
assert.type(testVar, type)
| Name | Type | Required | Default | Description |
|-----------|----------|----------|---------|---------------------------------------- |
| testVar | N/A
| yes
| N/A
| The variable you want to test |
| type | String
| yes
| N/A
| The type the variable should be |
import assert from ('@joegesualdo/assert')
let testStr = 'hello world';
assert.type(testStr, 'boolean');
//=> throws `TypeError`
Build
$ npm run build
License
MIT © Joe Gesualdo