Skip to content

Instantly share code, notes, and snippets.

HzJavier HzJavier

Block or report user

Report or block HzJavier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
HzJavier / sinon-async.js
Created Jun 23, 2016
Testing with Sinon stubs, promises and callbacks
View sinon-async.js
var sinon = require('sinon');
var chai = require('chai');
var expect = chai.expect;
var chaiAsPromised = require('chai-as-promised');
var Promise = require('bluebird');
var _ = require('lodash');
var subscriptionService = require('../../lib/services/subscription-service');
var addressService = require('../../lib/services/address-service');
var subscriptionResource = require('../../lib/resources/subscriptions-resource');
HzJavier / apply-vs-scope-saving.js
Created Sep 10, 2015
Trying to figure out which approach is better or cleaner or recommended.
View apply-vs-scope-saving.js
* Assume jQuery.
* Which approach is better?
this.someClass = 'some-class';
// Save the scope for later use
var that = this;
You can’t perform that action at this time.