From 6bd04e769a21f1ef8cba23e43d0de8ec5017185a Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 7 Sep 2023 13:45:40 +0200 Subject: [PATCH] test: fix tests after toolkit update Signed-off-by: CrazyMax --- __tests__/aws.test.ts | 1 + __tests__/context.test.ts | 1 + __tests__/docker.test.ts | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/__tests__/aws.test.ts b/__tests__/aws.test.ts index 30e82a6..55a368c 100644 --- a/__tests__/aws.test.ts +++ b/__tests__/aws.test.ts @@ -1,5 +1,6 @@ import {beforeEach, describe, expect, jest, test} from '@jest/globals'; import {AuthorizationData} from '@aws-sdk/client-ecr'; + import * as aws from '../src/aws'; describe('isECR', () => { diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 9f792de..8e46253 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -1,4 +1,5 @@ import {expect, test} from '@jest/globals'; + import {getInputs} from '../src/context'; test('with password and username getInputs does not throw error', async () => { diff --git a/__tests__/docker.test.ts b/__tests__/docker.test.ts index e480ba7..1f45be5 100644 --- a/__tests__/docker.test.ts +++ b/__tests__/docker.test.ts @@ -1,14 +1,15 @@ import {expect, jest, test} from '@jest/globals'; -import {loginStandard, logout} from '../src/docker'; import * as path from 'path'; -import * as exec from '@actions/exec'; + +import {loginStandard, logout} from '../src/docker'; +import {Exec} from '@docker/actions-toolkit/lib/exec'; process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner'); test('loginStandard calls exec', async () => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - const execSpy = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => { + const execSpy = jest.spyOn(Exec, 'getExecOutput').mockImplementation(async () => { return { exitCode: expect.any(Number), stdout: expect.any(Function), @@ -32,7 +33,7 @@ test('loginStandard calls exec', async () => { test('logout calls exec', async () => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - const execSpy = jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => { + const execSpy = jest.spyOn(Exec, 'getExecOutput').mockImplementation(async () => { return { exitCode: expect.any(Number), stdout: expect.any(Function),