promise-assert

Inline promise assertion library

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
promise-assert
1.0.58 years ago8 years agoMinified + gzip package size for promise-assert in KB

Readme

promise-assert
!NPM versionnpm-imagenpm-url !build statustravis-imagetravis-url !Test coveragecoveralls-imagecoveralls-url !Downloadsdownloads-imagedownloads-url !js-standard-stylestandard-imagestandard-url
Inline Promise assertion library.

Installation

$ npm install promise-assert

Usage

const pa = require('promise-assert')

Promise.resolve(1337)
  .then(pa.equal(1337))
  // => ok

API

pa()
Promise.resolve(false)
  .then(pa())
  // => AssertionError
pa.ok()
pa.ok() == pa()
pa.equal()
Promise.resolve('hello')
  .then(pa.equal('hello'))
  // => ok

License

MIT