lint fixes

This commit is contained in:
eggyhead committed 2024-01-31 16:51:04 +00:00
1 parent 3d34748d8e
commit b3211b7a79
2 files changed
+6 -5

No files matched your search

+3 -3
View File
@@ -3,8 +3,8 @@ import * as path from 'path'
import * as cacheUtils from '../src/internal/cacheUtils' 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')
@@ -61,4 +61,4 @@ test('isGhes returns true for enterprise URL', async () => {
test('isGhes returns false for ghe.localhost', () => { test('isGhes returns false for ghe.localhost', () => {
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost' process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost'
expect(cacheUtils.isGhes()).toBe(false) expect(cacheUtils.isGhes()).toBe(false)
}) })
+3 -2
View File
@@ -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
} }