jasmine-es6-promise-matchers.js
function(done, promise, expectedState, expectedData, isNegative) {
    function verify(promiseState) {
      return function(data) {
        var test = verifyState(promiseState, expectedState);

        if (test.pass) {
          test = verifyData(data, expectedData);
        }

        if (!test.pass && !isNegative) {
          done.fail(new Error(test.message));
          return;
        }

        done();
      }
    }

    promise.then(
      verify(PROMISE_STATE.RESOLVED),
      verify(PROMISE_STATE.REJECTED)
    );

    return { pass: true };
  }
function(done, promise, expectedState, expectedData, isNegative) {
    function verify(promiseState) {
      return function(data) {
        var test = verifyState(promiseState, expectedState);

        if (test.pass) {
          test = verifyData(data, expectedData);
        }

        if (!test.pass && !isNegative) {
          done.fail(new Error(test.message));
          return;
        }

        done();
      }
    }

    promise.then(
      verify(PROMISE_STATE.RESOLVED),
      verify(PROMISE_STATE.REJECTED)
    );

    return { pass: true };
  }
function ( done , promise , expectedState , expectedData , isNegative ) { function verify ( promiseState ) { return function ( data ) { var test = verifyState ( promiseState , expectedState ) ; if ( test . pass ) { test = verifyData ( data , expectedData ) ; } if ( ! test . pass && ! isNegative ) { done . fail ( new Error ( test . message ) ) ; return ; } done ( ) ; } } promise . then ( verify ( PROMISE_STATE . RESOLVED ) , verify ( PROMISE_STATE . REJECTED ) ) ; return { pass : true } ; }
Helper method to verify expectations and return a Jasmine-friendly info-object
Helper method to verify expectations and return a Jasmine - friendly info - object