Skip to content

Home > @opengovsg/testcontainers > getMappedPort

getMappedPort() function ​

Return the mapped host port for a container port. Throws if unmapped.

Signature:

typescript
getMappedPort: (container: ContainerInformation, containerPort: number) => number

Parameters ​

ParameterTypeDescription
containerContainerInformation
containerPortnumber

Returns:

number