tink/test/test.nonci.ts

37 lines
1.1 KiB
TypeScript
Raw 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;
2022-02-18 11:55:56 +00:00
tap.preTask('should delete existing users', async () => {
const preTinkAccount = tinkTestAccount = new tink.TinkAccount(
testQenv.getEnvVarOnDemand('TINK_CLIENT_ID'),
testQenv.getEnvVarOnDemand('TINK_CLIENT_SECRET')
);
expect(tinkTestAccount).toBeInstanceOf(tink.TinkAccount);
const tinkUser = new tink.TinkUser(preTinkAccount, null, 'user_1234_abc');
await tinkUser.delete();
})
2022-02-15 15:51:16 +00:00
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 () => {
2022-02-18 11:55:56 +00:00
await tinkTestAccount.createTinkUser("user_1234_abc");
2022-02-15 15:51:16 +00:00
})
2022-01-26 15:01:10 +00:00
tap.start();