Skip to content

Commit

Permalink
test: fix tests after toolkit update
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
CrazyMax committed Sep 9, 2023
1 parent a648524 commit 0e78034
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 69 deletions.
1 change: 1 addition & 0 deletions __tests__/aws.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
9 changes: 5 additions & 4 deletions __tests__/docker.test.ts
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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),
Expand Down
65 changes: 0 additions & 65 deletions __tests__/main.test.ts

This file was deleted.

0 comments on commit 0e78034

Please sign in to comment.