29 lines
773 B
TypeScript
29 lines
773 B
TypeScript
|
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||
|
import * as qenv from '@push.rocks/qenv';
|
||
|
const testQenv = new qenv.Qenv('./', './.nogit/');
|
||
|
|
||
|
import * as zitadel from '../ts/index.js'
|
||
|
import test from 'node:test';
|
||
|
|
||
|
|
||
|
let testZitadel: zitadel.ZitaldelClient;
|
||
|
|
||
|
tap.test('first test', async () => {
|
||
|
testZitadel = new zitadel.ZitaldelClient({
|
||
|
url: await testQenv.getEnvVarOnDemand('ZITADEL_URL'),
|
||
|
accessToken: await testQenv.getEnvVarOnDemand('ZITADEL_TOKEN')
|
||
|
});
|
||
|
});
|
||
|
|
||
|
tap.test('should list own user', async () => {
|
||
|
await testZitadel.listOwnUser();
|
||
|
})
|
||
|
|
||
|
tap.test('should list users', async () => {
|
||
|
const users = await testZitadel.listUsers();
|
||
|
expect(users).toBeArray();
|
||
|
expect(users[0]).toBeInstanceOf(zitadel.ZitaldelUser);
|
||
|
})
|
||
|
|
||
|
tap.start()
|