testcontainers
Version:
Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container
15 lines (14 loc) • 580 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseComposeContainerName = parseComposeContainerName;
function parseComposeContainerName(projectName, containerName) {
if (containerName.startsWith(`/${projectName}-`)) {
return containerName.substring(`/${projectName}-`.length);
}
else if (containerName.startsWith("/")) {
return containerName.substring(1);
}
else {
throw new Error(`Unable to resolve container name for container name: "${containerName}", project name: "${projectName}"`);
}
}