Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions src/docker-manager.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Tests for the docker-manager barrel module.
//
// docker-manager.ts re-exports the public API from several focused modules
// (host-env, config-writer, container-lifecycle, container-cleanup). Those
// modules have their own dedicated test suites; this file verifies that the
// barrel module itself correctly re-exports every expected symbol and that
// each symbol has the expected shape (function). This exercises the barrel's
// export statements for coverage purposes without duplicating the underlying
// module tests.

import * as dockerManager from './docker-manager';

describe('docker-manager (barrel re-exports)', () => {
it('re-exports host-env symbols', () => {
expect(typeof dockerManager.setAwfDockerHost).toBe('function');
expect(typeof dockerManager.getLocalDockerEnv).toBe('function');
expect(typeof dockerManager.parseDifcProxyHost).toBe('function');
});

it('re-exports config-writer symbols', () => {
expect(typeof dockerManager.writeConfigs).toBe('function');
});

it('re-exports container-lifecycle symbols', () => {
expect(typeof dockerManager.startContainers).toBe('function');
expect(typeof dockerManager.runAgentCommand).toBe('function');
expect(typeof dockerManager.fastKillAgentContainer).toBe('function');
});

it('re-exports container-cleanup symbols', () => {
expect(typeof dockerManager.collectDiagnosticLogs).toBe('function');
expect(typeof dockerManager.stopContainers).toBe('function');
expect(typeof dockerManager.preserveIptablesAudit).toBe('function');
expect(typeof dockerManager.cleanup).toBe('function');
});

it('exposes no unexpected additional exports', () => {
const expectedExports = new Set([
'setAwfDockerHost',
'getLocalDockerEnv',
'parseDifcProxyHost',
'writeConfigs',
'startContainers',
'runAgentCommand',
'fastKillAgentContainer',
'collectDiagnosticLogs',
'stopContainers',
'preserveIptablesAudit',
'cleanup',
]);
const actualExports = new Set(Object.keys(dockerManager));
expect(actualExports).toEqual(expectedExports);
});
});
Loading