Skip to content

Instantly share code, notes, and snippets.

@kumar303
Last active August 29, 2015 13:57
Show Gist options
  • Save kumar303/9652415 to your computer and use it in GitHub Desktop.
Save kumar303/9652415 to your computer and use it in GitHub Desktop.
mocha example
describe('fxpay', function() {
describe('purchase()', function() {
it('should error if mozPay() is undefined', function(done) {
var productId = '123';
fxpay.purchase(productId, {
onpurchase: function(error) {
assert.equal(error, 'PAY_PLATFORM_UNAVAILABLE');
done();
},
mozPay: undefined // override navigator.mozPay
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment