Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vstarostin committed Apr 1, 2024
1 parent 022d974 commit 18e4032
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import path from 'path'

import * as core from '@actions/core'
import * as artifact from '@actions/artifact'
import { type OctokitResponse } from '@octokit/types'
// import { type OctokitResponse } from '@octokit/types'

import * as config from '../src/config'
import * as execute from '../src/execute'
import * as github from '../src/github'
import {
import {
ENTERPRISE_DEFAULTS_FILENAME,
ENTERPRISE_STAGE_CONFIG_FILENAME
} from '../src/enterprise'
Expand Down Expand Up @@ -186,9 +186,9 @@ describe('Config', () => {
})
test('Download stage config', async () => {
// Mock implementation for 'Download stage config' test case
const mockGetReleaseAssetUrl = jest.spyOn(github, 'getReleaseAssetUrl');
mockGetReleaseAssetUrl.mockResolvedValue([`http://mock.test/asset/${ENTERPRISE_STAGE_CONFIG_FILENAME}`, 'v1.0.0']);
const mockGetReleaseAssetUrl = jest.spyOn(github, 'getReleaseAssetUrl')
mockGetReleaseAssetUrl.mockResolvedValue([`http://mock.test/asset/${ENTERPRISE_STAGE_CONFIG_FILENAME}`, 'v1.0.0'])

process.env.GITHUB_SERVER_URL = 'https://github.acme.com'
process.env.GITHUB_API_URL = 'https://github.acme.com/api/v3'

Expand Down Expand Up @@ -223,7 +223,7 @@ describe('Config', () => {

process.env.GITHUB_JOB = 'Init'

await config.createCheckIfStepActiveMaps('server','apiURL','version','testToken', 'something', 'nothing')
await config.createCheckIfStepActiveMaps('server', 'apiURL', 'version', 'testToken', 'something', 'nothing')

expect(config.downloadStageConfig).toHaveBeenCalled()
expect(config.checkIfStepActive).toHaveBeenCalled()
Expand Down
6 changes: 3 additions & 3 deletions test/enterprise.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('test enterprise.ts', () => {
process.env.GITHUB_SERVER_URL = GITHUB_COM_SERVER_URL
// test
// assert
expect(getEnterpriseConfigUrl('configType','apiURL','version', 'token','anything', 'something')).toBe('')
expect(getEnterpriseConfigUrl('configType', 'apiURL', 'version', 'token', 'anything', 'something')).toBe('')
})

describe('with enterprise github', () => {
Expand All @@ -62,7 +62,7 @@ describe('test enterprise.ts', () => {
const repository = 'something'
// test
// assert
expect(getEnterpriseConfigUrl(DEFAULT_CONFIG,'apiURL','version','token', owner, repository)).toBe(`${process.env.GITHUB_API_URL}/repos/${owner}/${repository}/contents/resources/${ENTERPRISE_STAGE_CONFIG_FILENAME}`)
expect(getEnterpriseConfigUrl(DEFAULT_CONFIG, 'apiURL', 'version', 'token', owner, repository)).toBe(`${process.env.GITHUB_API_URL}/repos/${owner}/${repository}/contents/resources/${ENTERPRISE_STAGE_CONFIG_FILENAME}`)
})

test('with no repository', async () => {
Expand All @@ -71,7 +71,7 @@ describe('test enterprise.ts', () => {
const repository = ''
// test
// assert
expect(getEnterpriseConfigUrl(STAGE_CONFIG,'apiURL','version','token', owner, repository)).toBe('')
expect(getEnterpriseConfigUrl(STAGE_CONFIG, 'apiURL', 'version', 'token', owner, repository)).toBe('')
})
})
})
Expand Down

0 comments on commit 18e4032

Please sign in to comment.