Files
coretraffic/test/test.nonci.ts
T

32 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-05-15 10:10:41 +02:00
delete process.env.CLI_CALL;
import * as coretraffic from '../ts/index.js';
import { tap, expect } from '@git.zone/tstest/tapbundle';
2024-05-15 10:10:41 +02:00
import { Qenv } from '@push.rocks/qenv';
const testQenv = new Qenv('./', './.nogit');
let testCoreTraffic: coretraffic.CoreTraffic;
const shouldRunIntegrationTests = process.env.CORETRAFFIC_INTEGRATION_TESTS === 'true';
2024-05-15 10:10:41 +02:00
tap.test('should create an coretraffic instance', async (tools) => {
testCoreTraffic = new coretraffic.CoreTraffic();
expect(testCoreTraffic).toBeInstanceOf(coretraffic.CoreTraffic);
});
tap.test('should start the instance', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to start CoreTraffic');
2024-05-15 10:10:41 +02:00
await testCoreTraffic.start();
});
tap.test('should keep the instance alive', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to keep CoreTraffic alive');
2024-05-15 10:10:41 +02:00
await tools.delayFor(10000);
});
tap.test('should stop the instance', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to stop CoreTraffic');
2024-05-15 10:10:41 +02:00
await testCoreTraffic.stop();
});
export default tap.start();