Skip to content

Commit

Permalink
update sinon
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed Jan 30, 2018
1 parent 9488ec2 commit 3dd7a3b
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 14 deletions.
112 changes: 105 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -186,7 +186,7 @@
"phantomjs-prebuilt": "^2.1.12",
"require-again": "^2.0.0",
"selenium-server": "^3.0.1",
"sinon": "^1.17.2",
"sinon": "^4.2.2",
"sinon-chai": "^2.8.0",
"sinon-stub-promise": "^4.0.0",
"webpack-bundle-analyzer": "^2.2.1",
Expand Down
6 changes: 5 additions & 1 deletion test/api/v3/unit/libs/payments.test.js
Expand Up @@ -413,10 +413,14 @@ describe('payments/index', () => {
});
});

context('Mystery Items', () => {
context.only('Mystery Items', () => {
it('awards mystery items when within the timeframe for a mystery item', async () => {
await user.save();
console.log('aa')
let mayMysteryItemTimeframe = 1464725113000; // May 31st 2016
let fakeClock = sinon.useFakeTimers(mayMysteryItemTimeframe);
await user.save();
console.log('bb')
data = { paymentMethod: 'PaymentMethod', user, sub: { key: 'basic_3mo' } };

await api.createSubscription(data);
Expand Down
Expand Up @@ -47,7 +47,7 @@ describe('#upgradeGroupPlan', () => {
});

afterEach(function () {
sinon.restore(amzLib.authorizeOnBillingAgreement);
amzLib.authorizeOnBillingAgreement.restore();
uuid.v4.restore();
});

Expand Down
Expand Up @@ -73,7 +73,7 @@ describe('checkout with subscription', () => {
});

afterEach(function () {
sinon.restore(stripe.subscriptions.update);
stripe.subscriptions.update.restore();
stripe.customers.create.restore();
payments.createSubscription.restore();
});
Expand Down
Expand Up @@ -45,7 +45,7 @@ describe('Stripe - Upgrade Group Plan', () => {
});

afterEach(function () {
sinon.restore(stripe.subscriptions.update);
stripe.subscriptions.update.restore();
});

it('updates a group plan quantity', async () => {
Expand Down
5 changes: 4 additions & 1 deletion test/api/v3/unit/libs/preening.test.js
Expand Up @@ -8,7 +8,10 @@ describe('preenHistory', () => {

beforeEach(() => {
// Replace system clocks so we can get predictable results
clock = sinon.useFakeTimers(Number(moment('2013-10-20').zone(0).startOf('day').toDate()), 'Date');
clock = sinon.useFakeTimers({
now: Number(moment('2013-10-20').zone(0).startOf('day').toDate()),
toFake: ['Date'],
});
});
afterEach(() => {
return clock.restore();
Expand Down
2 changes: 1 addition & 1 deletion test/api/v3/unit/libs/pushNotifications.js
Expand Up @@ -22,7 +22,7 @@ describe('pushNotifications', () => {

sandbox.stub(nconf, 'get').returns('true-key');

sandbox.stub(gcmLib.Sender.prototype, 'send', fcmSendSpy);
sandbox.stub(gcmLib.Sender.prototype, 'send').callsFake(fcmSendSpy);

sandbox.stub(pushNotify, 'apn').returns({
on: () => null,
Expand Down

0 comments on commit 3dd7a3b

Please sign in to comment.