mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 13:09:27 +08:00
adding updated lints and fixes
This commit is contained in:
parent
ba96334e72
commit
20e1b242c8
@ -239,7 +239,7 @@ describe('Download Tests', () => {
|
|||||||
*/
|
*/
|
||||||
async function emptyMockReadBody(): Promise<string> {
|
async function emptyMockReadBody(): Promise<string> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
resolve()
|
resolve('mockResolve')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ beforeAll(async () => {
|
|||||||
*/
|
*/
|
||||||
async function emptyMockReadBody(): Promise<string> {
|
async function emptyMockReadBody(): Promise<string> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
resolve()
|
resolve('mockResolved')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ describe('Upload Tests', () => {
|
|||||||
*/
|
*/
|
||||||
async function emptyMockReadBody(): Promise<string> {
|
async function emptyMockReadBody(): Promise<string> {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
resolve()
|
resolve('mockResolve')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,8 +461,7 @@ describe('Upload Tests', () => {
|
|||||||
fileContainerResourceUrl: `${getRuntimeUrl()}_apis/resources/Containers/13`,
|
fileContainerResourceUrl: `${getRuntimeUrl()}_apis/resources/Containers/13`,
|
||||||
type: 'actions_storage',
|
type: 'actions_storage',
|
||||||
name: inputData.Name,
|
name: inputData.Name,
|
||||||
url: `${getRuntimeUrl()}_apis/pipelines/1/runs/1/artifacts?artifactName=${
|
url: `${getRuntimeUrl()}_apis/pipelines/1/runs/1/artifacts?artifactName=${inputData.Name
|
||||||
inputData.Name
|
|
||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
const returnData: string = JSON.stringify(response, null, 2)
|
const returnData: string = JSON.stringify(response, null, 2)
|
||||||
|
@ -113,8 +113,7 @@ export class DownloadHttpClient {
|
|||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
core.debug(
|
core.debug(
|
||||||
`File: ${++downloadedFiles}/${downloadItems.length}. ${
|
`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath
|
||||||
currentFileToDownload.targetPath
|
|
||||||
} took ${(performance.now() - startTime).toFixed(
|
} took ${(performance.now() - startTime).toFixed(
|
||||||
3
|
3
|
||||||
)} milliseconds to finish downloading`
|
)} milliseconds to finish downloading`
|
||||||
@ -328,7 +327,7 @@ export class DownloadHttpClient {
|
|||||||
})
|
})
|
||||||
.pipe(destinationStream)
|
.pipe(destinationStream)
|
||||||
.on('close', () => {
|
.on('close', () => {
|
||||||
resolve()
|
resolve('closed')
|
||||||
})
|
})
|
||||||
.on('error', error => {
|
.on('error', error => {
|
||||||
core.info(
|
core.info(
|
||||||
@ -347,7 +346,7 @@ export class DownloadHttpClient {
|
|||||||
})
|
})
|
||||||
.pipe(destinationStream)
|
.pipe(destinationStream)
|
||||||
.on('close', () => {
|
.on('close', () => {
|
||||||
resolve()
|
resolve('closed')
|
||||||
})
|
})
|
||||||
.on('error', error => {
|
.on('error', error => {
|
||||||
core.info(
|
core.info(
|
||||||
|
@ -19,7 +19,7 @@ describe('@actions/github', () => {
|
|||||||
proxyServer = proxy()
|
proxyServer = proxy()
|
||||||
await new Promise(resolve => {
|
await new Promise(resolve => {
|
||||||
const port = Number(proxyUrl.split(':')[2])
|
const port = Number(proxyUrl.split(':')[2])
|
||||||
proxyServer.listen(port, () => resolve())
|
proxyServer.listen(port, () => resolve('mockResolve'))
|
||||||
})
|
})
|
||||||
proxyServer.on('connect', req => {
|
proxyServer.on('connect', req => {
|
||||||
proxyConnects.push(req.url ?? '')
|
proxyConnects.push(req.url ?? '')
|
||||||
@ -33,7 +33,7 @@ describe('@actions/github', () => {
|
|||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
// Stop proxy server
|
// Stop proxy server
|
||||||
await new Promise(resolve => {
|
await new Promise(resolve => {
|
||||||
proxyServer.once('close', () => resolve())
|
proxyServer.once('close', () => resolve('closed'))
|
||||||
proxyServer.close()
|
proxyServer.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user