fix(deps): Update dependencies to latest versions
This commit is contained in:
23
test/helpers/cloudlyfactory.ts
Normal file
23
test/helpers/cloudlyfactory.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { Qenv } from '@push.rocks/qenv';
|
||||
const testQenv = new Qenv('./', './.nogit/');
|
||||
|
||||
import * as cloudly from '../../ts/index.js';
|
||||
|
||||
export const createCloudly = async () => {
|
||||
const cloudlyConfig: cloudly.ICloudlyConfig = {
|
||||
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
|
||||
environment: 'integration',
|
||||
letsEncryptEmail: await testQenv.getEnvVarOnDemand('LETSENCRYPT_EMAIL'),
|
||||
publicUrl: await testQenv.getEnvVarOnDemand('SERVEZONE_URL'),
|
||||
publicPort: await testQenv.getEnvVarOnDemand('SERVEZONE_PORT'),
|
||||
mongoDescriptor: {
|
||||
mongoDbName: await testQenv.getEnvVarOnDemand('MONGODB_DATABASE'),
|
||||
mongoDbUser: await testQenv.getEnvVarOnDemand('MONGODB_USER'),
|
||||
mongoDbPass: await testQenv.getEnvVarOnDemand('MONGODB_PASSWORD'),
|
||||
mongoDbUrl: await testQenv.getEnvVarOnDemand('MONGODB_URL'),
|
||||
},
|
||||
};
|
||||
const cloudlyInstance = new cloudly.Cloudly();
|
||||
return cloudlyInstance;
|
||||
}
|
||||
|
1
test/helpers/index.ts
Normal file
1
test/helpers/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './cloudlyfactory.js';
|
@ -9,15 +9,21 @@ tap.test('should create a new cloudlyApiClient', async () => {
|
||||
registerAs: 'api',
|
||||
cloudlyUrl: 'http://localhost:3000',
|
||||
});
|
||||
await testClient.start();
|
||||
// await testClient.start();
|
||||
expect(testClient).toBeTruthy();
|
||||
});
|
||||
|
||||
tap.test('should get an identity', async () => {
|
||||
const identity = await testClient.getIdentityByJumpCode('test');
|
||||
expect(identity).toBeTruthy();
|
||||
});
|
||||
|
||||
tap.test('should trigger a server action', async () => {
|
||||
|
||||
})
|
||||
|
||||
tap.test('should stop the apiclient', async () => {
|
||||
tap.test('should stop the apiclient', async (toolsArg) => {
|
||||
await toolsArg.delayFor(1000);
|
||||
await testClient.stop();
|
||||
})
|
||||
|
||||
|
21
test/test.ts
21
test/test.ts
@ -1,28 +1,11 @@
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import { Qenv } from '@push.rocks/qenv';
|
||||
const testQenv = new Qenv('./', './.nogit/');
|
||||
process.env.TESTING_CLOUDLY = 'true';
|
||||
|
||||
delete process.env.CLI_CALL;
|
||||
import * as helpers from './helpers/index.js';
|
||||
|
||||
import * as cloudly from '../ts/index.js';
|
||||
|
||||
let testCloudly: cloudly.Cloudly;
|
||||
tap.test('first test', async () => {
|
||||
const cloudlyConfig: cloudly.ICloudlyConfig = {
|
||||
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
|
||||
environment: 'integration',
|
||||
letsEncryptEmail: await testQenv.getEnvVarOnDemand('LETSENCRYPT_EMAIL'),
|
||||
publicUrl: await testQenv.getEnvVarOnDemand('SERVEZONE_URL'),
|
||||
publicPort: await testQenv.getEnvVarOnDemand('SERVEZONE_PORT'),
|
||||
mongoDescriptor: {
|
||||
mongoDbName: await testQenv.getEnvVarOnDemand('MONGODB_DATABASE'),
|
||||
mongoDbUser: await testQenv.getEnvVarOnDemand('MONGODB_USER'),
|
||||
mongoDbPass: await testQenv.getEnvVarOnDemand('MONGODB_PASSWORD'),
|
||||
mongoDbUrl: await testQenv.getEnvVarOnDemand('MONGODB_URL'),
|
||||
},
|
||||
};
|
||||
testCloudly = new cloudly.Cloudly();
|
||||
testCloudly = await helpers.createCloudly();
|
||||
expect(testCloudly).toBeInstanceOf(cloudly.Cloudly);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user