Files
actions-setup-docker-compose/__tests__/install.test.ts
Kengo TODA ececfe4aee test: reformat jest test cases
Signed-off-by: Kengo TODA <skypencil@gmail.com>
2022-09-04 09:40:11 +08:00

22 lines
689 B
TypeScript

import {install, runCommand} from '../src/install'
import * as core from '@actions/core'
import {describe, expect, it, test} from '@jest/globals'
describe('runCommand', () => {
it('runs a command and returns its stdout', async () => {
const result = await runCommand('echo foo bar')
expect(result).toBe('foo bar')
})
})
describe('install', () => {
const cases = ['1.29.1', '1.29.2', '2.2.3', 'v2.2.3', 'v2.10.2']
test.each(cases)('can install version %p', async (version: string) => {
const commandPath = await install(version)
core.addPath(commandPath)
const result = await runCommand('docker-compose version')
expect(result).toContain(version)
})
})