diff --git a/src/docker-manager.test.ts b/src/docker-manager.test.ts new file mode 100644 index 000000000..5887d447a --- /dev/null +++ b/src/docker-manager.test.ts @@ -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); + }); +});