mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 09:09:10 +08:00
formatting fixes
This commit is contained in:
parent
b680ef8e68
commit
4efc4b9e06
@ -1,10 +1,8 @@
|
|||||||
import * as config from '../src/internal/shared/config'
|
import * as config from '../src/internal/shared/config'
|
||||||
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.resetModules()
|
jest.resetModules()
|
||||||
});
|
})
|
||||||
|
|
||||||
|
|
||||||
describe('isGhes', () => {
|
describe('isGhes', () => {
|
||||||
it('should return false when the request domain is github.com', () => {
|
it('should return false when the request domain is github.com', () => {
|
||||||
@ -17,7 +15,6 @@ describe('isGhes', () => {
|
|||||||
expect(config.isGhes()).toBe(false)
|
expect(config.isGhes()).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it('should return false when the request domain is specific to an enterprise', () => {
|
it('should return false when the request domain is specific to an enterprise', () => {
|
||||||
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
|
||||||
expect(config.isGhes()).toBe(true)
|
expect(config.isGhes()).toBe(true)
|
||||||
|
@ -28,8 +28,9 @@ export function isGhes(): boolean {
|
|||||||
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
||||||
)
|
)
|
||||||
|
|
||||||
const isGitHubHost = (ghUrl.hostname.trimEnd().toUpperCase() === 'GITHUB.COM')
|
const isGitHubHost = ghUrl.hostname.trimEnd().toUpperCase() === 'GITHUB.COM'
|
||||||
const isResultsServiceRequest = process.env['ACTIONS_RESULTS_URL'] != undefined
|
const isResultsServiceRequest =
|
||||||
|
process.env['ACTIONS_RESULTS_URL'] != undefined
|
||||||
|
|
||||||
return !isGitHubHost && !isResultsServiceRequest
|
return !isGitHubHost && !isResultsServiceRequest
|
||||||
}
|
}
|
||||||
|
2
packages/cache/__tests__/cacheUtils.test.ts
vendored
2
packages/cache/__tests__/cacheUtils.test.ts
vendored
@ -4,7 +4,7 @@ import * as cacheUtils from '../src/internal/cacheUtils'
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.resetModules()
|
jest.resetModules()
|
||||||
});
|
})
|
||||||
|
|
||||||
test('getArchiveFileSizeInBytes returns file size', () => {
|
test('getArchiveFileSizeInBytes returns file size', () => {
|
||||||
const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt')
|
const filePath = path.join(__dirname, '__fixtures__', 'helloWorld.txt')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user