mirror of
https://github.com/danbulant/docker-compose
synced 2026-05-19 04:18:32 +00:00
Add a version function
This commit is contained in:
parent
1585dbb62a
commit
db73df9b0f
2 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue