refactor: rename result to data

This commit is contained in:
Alexander Zeitler 2021-04-11 14:53:03 +02:00
parent aa26e83884
commit 90421b7eb2
2 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@ export type TypedDockerComposeResult<T> = {
exitCode: number | null exitCode: number | null
out: string out: string
err: string err: string
result: T data: T
} }
/** /**
@ -367,7 +367,7 @@ export const port = async function (
const [address, port] = result.out.split(':') const [address, port] = result.out.split(':')
return { return {
...result, ...result,
result: { data: {
address, address,
port: Number(port) port: Number(port)
} }

View file

@ -372,8 +372,8 @@ test('build accepts config as string', async (): Promise<void> => {
await compose.upAll(config) await compose.upAll(config)
const result = await compose.port('web', 8888, config) const result = await compose.port('web', 8888, config)
expect(result.result.address).toBe('0.0.0.0') expect(result.data.address).toBe('0.0.0.0')
expect(result.result.port).toBe(8888) expect(result.data.port).toBe(8888)
await compose.down(config) await compose.down(config)
}) })