From d22d160f7171e549afde742c9be350614e935717 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 29 Mar 2024 14:36:10 +0100 Subject: [PATCH] Fix typecheck --- workflow_tests/README.md | 4 ++-- workflow_tests/authorChecklist.test.ts | 6 +++--- workflow_tests/cherryPick.test.ts | 6 +++--- workflow_tests/cla.test.ts | 6 +++--- workflow_tests/createNewVersion.test.ts | 4 ++-- workflow_tests/deploy.test.ts | 4 ++-- workflow_tests/deployBlocker.test.ts | 4 ++-- workflow_tests/failureNotifier.test.ts | 4 ++-- workflow_tests/finishReleaseCycle.test.ts | 4 ++-- workflow_tests/lint.test.ts | 4 ++-- workflow_tests/lockDeploys.test.ts | 6 +++--- workflow_tests/platformDeploy.test.ts | 6 +++--- workflow_tests/preDeploy.test.ts | 6 +++--- workflow_tests/reviewerChecklist.test.ts | 6 +++--- workflow_tests/test.test.ts | 6 +++--- 15 files changed, 38 insertions(+), 38 deletions(-) diff --git a/workflow_tests/README.md b/workflow_tests/README.md index 0c491fe6d9e0..b55e2691d13e 100644 --- a/workflow_tests/README.md +++ b/workflow_tests/README.md @@ -246,7 +246,7 @@ const FILES_TO_COPY_INTO_TEST_REPO = [ ]; beforeEach(async () => { - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testWorkflowsRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, @@ -339,7 +339,7 @@ const FILES_TO_COPY_INTO_TEST_REPO = [ `beforeEach` gets executed before each test. Here we create the local test repository with the files defined in the `FILES_TO_COPY_INTO_TEST_REPO` variable. `testWorkflowRepo` is the name of the test repo and can be changed to whichever name you choose, just remember to use it later when accessing this repo. _Note that we can't use `beforeAll()` method, because while mocking steps `Act-js` modifies the workflow file copied into the test repo and thus mocking could persist between tests_ ```javascript beforeEach(async () => { - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testWorkflowsRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/authorChecklist.test.ts b/workflow_tests/authorChecklist.test.ts index c0b1c7cf7533..84509818ff61 100644 --- a/workflow_tests/authorChecklist.test.ts +++ b/workflow_tests/authorChecklist.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/authorChecklistAssertions'; import mocks from './mocks/authorChecklistMocks'; @@ -30,7 +30,7 @@ describe('test workflow authorChecklist', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testAuthorChecklistWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/cherryPick.test.ts b/workflow_tests/cherryPick.test.ts index 47a1c489df70..56ce851755b6 100644 --- a/workflow_tests/cherryPick.test.ts +++ b/workflow_tests/cherryPick.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/cherryPickAssertions'; import mocks from './mocks/cherryPickMocks'; @@ -29,7 +29,7 @@ describe('test workflow cherryPick', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testCherryPickWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/cla.test.ts b/workflow_tests/cla.test.ts index 1de0988d9107..31a721305b20 100644 --- a/workflow_tests/cla.test.ts +++ b/workflow_tests/cla.test.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type {Step} from '@kie/act-js'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import {assertCLAJobExecuted} from './assertions/claAssertions'; import {CLA__CLA__CHECK_MATCH__STEP_MOCKS, CLA__CLA__NO_MATCHES__STEP_MOCKS, CLA__CLA__RECHECK_MATCH__STEP_MOCKS} from './mocks/claMocks'; @@ -36,7 +36,7 @@ describe('test workflow cla', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testClaWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/createNewVersion.test.ts b/workflow_tests/createNewVersion.test.ts index 786d9096821b..05dcc2b10073 100644 --- a/workflow_tests/createNewVersion.test.ts +++ b/workflow_tests/createNewVersion.test.ts @@ -1,4 +1,4 @@ -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/createNewVersionAssertions'; import mocks from './mocks/createNewVersionMocks'; @@ -25,7 +25,7 @@ describe('test workflow createNewVersion', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testCreateNewVersionWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/deploy.test.ts b/workflow_tests/deploy.test.ts index 201d025b8d44..4edb3b252d38 100644 --- a/workflow_tests/deploy.test.ts +++ b/workflow_tests/deploy.test.ts @@ -1,4 +1,4 @@ -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/deployAssertions'; import mocks from './mocks/deployMocks'; @@ -25,7 +25,7 @@ describe('test workflow deploy', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testDeployWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/deployBlocker.test.ts b/workflow_tests/deployBlocker.test.ts index b9fa4a5a34bb..eb4cdc2c9497 100644 --- a/workflow_tests/deployBlocker.test.ts +++ b/workflow_tests/deployBlocker.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/deployBlockerAssertions'; import mocks from './mocks/deployBlockerMocks'; @@ -33,7 +33,7 @@ describe('test workflow deployBlocker', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testDeployBlockerWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/failureNotifier.test.ts b/workflow_tests/failureNotifier.test.ts index c2328220bf12..07ebb45517b3 100644 --- a/workflow_tests/failureNotifier.test.ts +++ b/workflow_tests/failureNotifier.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; +import {MockGithub} from '@kie/mock-github'; import type {CreateRepositoryFile} from '@kie/mock-github'; -import * as kieMockGithub from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/failureNotifierAssertions'; import mocks from './mocks/failureNotifierMocks'; @@ -20,7 +20,7 @@ describe('test workflow failureNotifier', () => { const actor = 'Dummy Actor'; beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testFailureNotifierWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/finishReleaseCycle.test.ts b/workflow_tests/finishReleaseCycle.test.ts index 0b5692790ed2..7f81137807f4 100644 --- a/workflow_tests/finishReleaseCycle.test.ts +++ b/workflow_tests/finishReleaseCycle.test.ts @@ -1,4 +1,4 @@ -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/finishReleaseCycleAssertions'; import mocks from './mocks/finishReleaseCycleMocks'; @@ -26,7 +26,7 @@ describe('test workflow finishReleaseCycle', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testFinishReleaseCycleWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/lint.test.ts b/workflow_tests/lint.test.ts index 4fdfd5e330c5..e0b0fb13859d 100644 --- a/workflow_tests/lint.test.ts +++ b/workflow_tests/lint.test.ts @@ -1,4 +1,4 @@ -import * as kieMockGithub from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/lintAssertions'; import mocks from './mocks/lintMocks'; @@ -28,7 +28,7 @@ describe('test workflow lint', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testLintWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/lockDeploys.test.ts b/workflow_tests/lockDeploys.test.ts index be739b963cbb..c9b083b4d804 100644 --- a/workflow_tests/lockDeploys.test.ts +++ b/workflow_tests/lockDeploys.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/lockDeploysAssertions'; import mocks from './mocks/lockDeploysMocks'; @@ -28,7 +28,7 @@ describe('test workflow lockDeploys', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testLockDeploysWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/platformDeploy.test.ts b/workflow_tests/platformDeploy.test.ts index 82903b3bbe14..0ac68eb6d55b 100644 --- a/workflow_tests/platformDeploy.test.ts +++ b/workflow_tests/platformDeploy.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/platformDeployAssertions'; import mocks from './mocks/platformDeployMocks'; @@ -29,7 +29,7 @@ describe('test workflow platformDeploy', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testPlatformDeployWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/preDeploy.test.ts b/workflow_tests/preDeploy.test.ts index b75603c5e846..1739fec13815 100644 --- a/workflow_tests/preDeploy.test.ts +++ b/workflow_tests/preDeploy.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/preDeployAssertions'; import mocks from './mocks/preDeployMocks'; @@ -29,7 +29,7 @@ describe('test workflow preDeploy', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testPreDeployWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/reviewerChecklist.test.ts b/workflow_tests/reviewerChecklist.test.ts index 07b325f9d699..d70afd31f115 100644 --- a/workflow_tests/reviewerChecklist.test.ts +++ b/workflow_tests/reviewerChecklist.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/reviewerChecklistAssertions'; import mocks from './mocks/reviewerChecklistMocks'; @@ -31,7 +31,7 @@ describe('test workflow reviewerChecklist', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testReviewerChecklistWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO, diff --git a/workflow_tests/test.test.ts b/workflow_tests/test.test.ts index 331a657a486c..085a2b3902d6 100644 --- a/workflow_tests/test.test.ts +++ b/workflow_tests/test.test.ts @@ -1,6 +1,6 @@ import type {MockStep} from '@kie/act-js/build/src/step-mocker/step-mocker.types'; -import * as kieMockGithub from '@kie/mock-github'; -import type {CreateRepositoryFile, MockGithub} from '@kie/mock-github'; +import {MockGithub} from '@kie/mock-github'; +import type {CreateRepositoryFile} from '@kie/mock-github'; import path from 'path'; import assertions from './assertions/testAssertions'; import mocks from './mocks/testMocks'; @@ -32,7 +32,7 @@ describe('test workflow test', () => { beforeEach(async () => { // create a local repository and copy required files - mockGithub = new kieMockGithub.MockGithub({ + mockGithub = new MockGithub({ repo: { testTestWorkflowRepo: { files: FILES_TO_COPY_INTO_TEST_REPO,