2026-05-08 13:56:20 +00:00
|
|
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
2024-04-20 12:21:41 +02:00
|
|
|
import { Qenv } from '@push.rocks/qenv';
|
|
|
|
|
const testQenv = new Qenv('./', './.nogit/');
|
|
|
|
|
|
|
|
|
|
delete process.env.CLI_CALL;
|
|
|
|
|
|
2026-05-08 13:56:20 +00:00
|
|
|
import * as cloudly from '../ts/index.js';
|
2024-04-20 12:21:41 +02:00
|
|
|
|
|
|
|
|
process.env.TESTING_CLOUDLY = 'true';
|
|
|
|
|
|
|
|
|
|
let testCloudly: cloudly.Cloudly;
|
|
|
|
|
|
|
|
|
|
tap.test('first test', async () => {
|
|
|
|
|
const cloudlyConfig: cloudly.ICloudlyConfig = {
|
|
|
|
|
environment: 'integration',
|
2026-05-08 13:56:20 +00:00
|
|
|
letsEncryptEmail: await testQenv.getEnvVarOnDemandStrict('LETSENCRYPT_EMAIL'),
|
|
|
|
|
publicUrl: await testQenv.getEnvVarOnDemandStrict('SERVEZONE_URL'),
|
|
|
|
|
publicPort: await testQenv.getEnvVarOnDemandStrict('SERVEZONE_PORT'),
|
2024-04-20 12:21:41 +02:00
|
|
|
mongoDescriptor: {
|
2026-05-08 13:56:20 +00:00
|
|
|
mongoDbName: await testQenv.getEnvVarOnDemandStrict('MONGODB_DATABASE'),
|
|
|
|
|
mongoDbPass: await testQenv.getEnvVarOnDemandStrict('MONGODB_PASSWORD'),
|
|
|
|
|
mongoDbUrl: await testQenv.getEnvVarOnDemandStrict('MONGODB_URL')
|
2024-04-20 12:21:41 +02:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
testCloudly = new cloudly.Cloudly(cloudlyConfig);
|
2026-05-08 13:56:20 +00:00
|
|
|
expect(testCloudly).toBeInstanceOf(cloudly.Cloudly);
|
2024-04-20 12:21:41 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tap.test('should init servezone', async () => {
|
|
|
|
|
await testCloudly.start();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
tap.test('should end the service', async () => {
|
|
|
|
|
await testCloudly.stop();
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-08 13:56:20 +00:00
|
|
|
export default tap.start();
|