diff --git a/src/index.ts b/src/index.ts index 6279897..0b50630 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 { + return execCompose('version', [ '--short' ], options); +}; diff --git a/test/index.test.ts b/test/index.test.ts index da8b44f..01f0d2b 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -490,3 +490,9 @@ test('returns the port for a started service', async (): Promise => { expect(port.out).toMatch(/.*:[0-9]{1,5}/); await compose.down(config); }); + +test('returns version information', async (): Promise => { + const version = await compose.version(); + + expect(version.out).toBeTruthy(); +});