should-reject

1.1.0 • Public • Published

should-reject

Return a promise which is resolved when the original promise is rejected, and rejected when the original promise is resolved

Example

var shouldReject = require('should-reject');
var login = require('./login'); //A function that returns a promise
shouldReject(login('username','wrongPassword')).then(function() {
  console.log('Login function is ok');
},function() {
  console.log('Something is wrong with the login function');
});

/should-reject/

    Package Sidebar

    Install

    npm i should-reject

    Weekly Downloads

    2

    Version

    1.1.0

    License

    ISC

    Last publish

    Collaborators

    • someone235