mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-04 05:12:55 +08:00
lint fixes
This commit is contained in:
parent
3b02a6fdc5
commit
d134334a38
@ -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', () => {
|
||||||
|
|||||||
@ -29,8 +29,9 @@ export function isGhes(): boolean {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
||||||
const isGitHubHost = (hostname == 'GITHUB.COM')
|
const isGitHubHost = hostname === 'GITHUB.COM'
|
||||||
const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'))
|
const isGheHost =
|
||||||
|
hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')
|
||||||
|
|
||||||
return !isGitHubHost && !isGheHost
|
return !isGitHubHost && !isGheHost
|
||||||
}
|
}
|
||||||
|
|||||||
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')
|
||||||
|
|||||||
5
packages/cache/src/internal/cacheUtils.ts
vendored
5
packages/cache/src/internal/cacheUtils.ts
vendored
@ -137,8 +137,9 @@ export function isGhes(): boolean {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase()
|
||||||
const isGitHubHost = (hostname == 'GITHUB.COM')
|
const isGitHubHost = hostname === 'GITHUB.COM'
|
||||||
const isGheHost = (hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST'))
|
const isGheHost =
|
||||||
|
hostname.endsWith('.GHE.COM') || hostname.endsWith('.GHE.LOCALHOST')
|
||||||
|
|
||||||
return !isGitHubHost && !isGheHost
|
return !isGitHubHost && !isGheHost
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user