Merge pull request #97 from wbobeirne/version-fn

Add a 'version' function
This commit is contained in:
Alexander Zeitler 2019-10-25 23:30:50 +02:00 committed by GitHub
commit 5b72a35f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -235,3 +235,7 @@ export const port = function (service: string, containerPort: string | number, o
return execCompose('port', args, options);
};
export const version = function (options?: IDockerComposeOptions): Promise<IDockerComposeResult> {
return execCompose('version', [ '--short' ], options);
};

View file

@ -490,3 +490,9 @@ test('returns the port for a started service', async (): Promise<void> => {
expect(port.out).toMatch(/.*:[0-9]{1,5}/);
await compose.down(config);
});
test('returns version information', async (): Promise<void> => {
const version = await compose.version();
expect(version.out).toBeTruthy();
});