tink/test/test.ts

27 lines
773 B
TypeScript
Raw Permalink Normal View History

2022-02-15 15:51:16 +00:00
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import * as qenv from '@pushrocks/qenv';
const testQenv = new qenv.Qenv('./', './.nogit/');
2022-01-26 15:01:10 +00:00
import * as tink from '../ts/index';
2022-02-15 15:51:16 +00:00
let tinkTestAccount: tink.TinkAccount;
tap.test('should create a valid tink account', async () => {
tinkTestAccount = new tink.TinkAccount(
testQenv.getEnvVarOnDemand('TINK_CLIENT_ID'),
testQenv.getEnvVarOnDemand('TINK_CLIENT_SECRET')
);
expect(tinkTestAccount).toBeInstanceOf(tink.TinkAccount);
2022-01-26 15:01:10 +00:00
});
2022-02-15 15:51:16 +00:00
tap.test('should report tink as healthy', async () => {
await expectAsync(tinkTestAccount.getTinkHealthyBoolean()).toBeTrue();
});
tap.test('should create a valid request', async () => {
await tinkTestAccount.request('', 'POST', '', {});
})
2022-01-26 15:01:10 +00:00
tap.start();