Skip to content

Instantly share code, notes, and snippets.

@mokkabonna
Created March 16, 2014 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mokkabonna/9590191 to your computer and use it in GitHub Desktop.
Save mokkabonna/9590191 to your computer and use it in GitHub Desktop.
promises for expect.js
var eventually = {
expect: function(promise) {
function notBe(expectedValue) {
return promise.then(function(eventualValue) {
expect(eventualValue).not.to.be(expectedValue);
});
}
function be(expectedValue) {
return promise.then(function(eventualValue) {
expect(eventualValue).to.be(expectedValue);
});
}
var exp = {
to: {
be: be
},
not: {
to: {
be: notBe
}
}
};
return exp;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment