paypal/test/test.ts
2020-08-21 15:40:04 +00:00

22 lines
640 B
TypeScript

import { expect, tap } from '@pushrocks/tapbundle';
import * as paypal from '../ts/index';
import { Qenv } from '@pushrocks/qenv';
const testQenv = new Qenv('./', './.nogit/');
let testPayPalInstance: paypal.PayPal;
tap.test('should create a valid paypal instance', async () => {
testPayPalInstance = new paypal.PayPal({
clientId: testQenv.getEnvVarOnDemand('PAYPAL_CLIENT_ID'),
clientSecret: testQenv.getEnvVarOnDemand('PAYPAL_CLIENT_SECRET'),
});
expect(testPayPalInstance).to.be.instanceOf(paypal.PayPal);
});
tap.test('should get an access token', async () => {
await testPayPalInstance.request();
});
tap.start();