refactor: migrate coretraffic to current smartproxy

This commit is contained in:
2026-04-28 12:02:58 +00:00
parent ed595918e2
commit 44ce9c8900
12 changed files with 4391 additions and 3514 deletions
+6 -2
View File
@@ -1,11 +1,12 @@
delete process.env.CLI_CALL;
import * as coretraffic from '../ts/index.js';
import { tap, expect } from '@push.rocks/tapbundle';
import { tap, expect } from '@git.zone/tstest/tapbundle';
import { Qenv } from '@push.rocks/qenv';
const testQenv = new Qenv('./', './.nogit');
let testCoreTraffic: coretraffic.CoreTraffic;
const shouldRunIntegrationTests = process.env.CORETRAFFIC_INTEGRATION_TESTS === 'true';
tap.test('should create an coretraffic instance', async (tools) => {
testCoreTraffic = new coretraffic.CoreTraffic();
@@ -13,15 +14,18 @@ tap.test('should create an coretraffic instance', async (tools) => {
});
tap.test('should start the instance', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to start CoreTraffic');
await testCoreTraffic.start();
});
tap.test('should keep the instance alive', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to keep CoreTraffic alive');
await tools.delayFor(10000);
});
tap.test('should stop the instance', async (tools) => {
tools.skipIf(!shouldRunIntegrationTests, 'set CORETRAFFIC_INTEGRATION_TESTS=true to stop CoreTraffic');
await testCoreTraffic.stop();
});
tap.start();
export default tap.start();