build: enable JS semicolons (#22783)

This commit is contained in:
Samuel Attard 2020-03-20 13:28:31 -07:00 committed by GitHub
parent 24e21467b9
commit 5d657dece4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
354 changed files with 21512 additions and 21510 deletions

View file

@ -1,37 +1,37 @@
import { expect } from 'chai'
import { inAppPurchase } from 'electron'
import { expect } from 'chai';
import { inAppPurchase } from 'electron';
describe('inAppPurchase module', function () {
if (process.platform !== 'darwin') return
if (process.platform !== 'darwin') return;
this.timeout(3 * 60 * 1000)
this.timeout(3 * 60 * 1000);
it('canMakePayments() returns a boolean', () => {
const canMakePayments = inAppPurchase.canMakePayments()
expect(canMakePayments).to.be.a('boolean')
})
const canMakePayments = inAppPurchase.canMakePayments();
expect(canMakePayments).to.be.a('boolean');
});
it('restoreCompletedTransactions() does not throw', () => {
expect(() => {
inAppPurchase.restoreCompletedTransactions()
}).to.not.throw()
})
inAppPurchase.restoreCompletedTransactions();
}).to.not.throw();
});
it('finishAllTransactions() does not throw', () => {
expect(() => {
inAppPurchase.finishAllTransactions()
}).to.not.throw()
})
inAppPurchase.finishAllTransactions();
}).to.not.throw();
});
it('finishTransactionByDate() does not throw', () => {
expect(() => {
inAppPurchase.finishTransactionByDate(new Date().toISOString())
}).to.not.throw()
})
inAppPurchase.finishTransactionByDate(new Date().toISOString());
}).to.not.throw();
});
it('getReceiptURL() returns receipt URL', () => {
expect(inAppPurchase.getReceiptURL()).to.match(/_MASReceipt\/receipt$/)
})
expect(inAppPurchase.getReceiptURL()).to.match(/_MASReceipt\/receipt$/);
});
// The following three tests are disabled because they hit Apple servers, and
// Apple started blocking requests from AWS IPs (we think), so they fail on CI.
@ -39,18 +39,18 @@ describe('inAppPurchase module', function () {
// without relying on a remote service.
xdescribe('handles product purchases', () => {
it('purchaseProduct() fails when buying invalid product', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist', 1)
expect(success).to.be.false('failed to purchase non-existent product')
})
const success = await inAppPurchase.purchaseProduct('non-exist', 1);
expect(success).to.be.false('failed to purchase non-existent product');
});
it('purchaseProduct() accepts optional arguments', async () => {
const success = await inAppPurchase.purchaseProduct('non-exist')
expect(success).to.be.false('failed to purchase non-existent product')
})
const success = await inAppPurchase.purchaseProduct('non-exist');
expect(success).to.be.false('failed to purchase non-existent product');
});
it('getProducts() returns an empty list when getting invalid product', async () => {
const products = await inAppPurchase.getProducts(['non-exist'])
expect(products).to.be.an('array').of.length(0)
})
})
})
const products = await inAppPurchase.getProducts(['non-exist']);
expect(products).to.be.an('array').of.length(0);
});
});
});