Re-enable the audit tools step and update dependencies (#815)
* update package versions * run audit * fix eslint config * linter updates * re-enable audit * update timeouts test * pass done into callback * fix format
This commit is contained in:
1 parent
f6c5e6951b
commit
d445878917
6 files changed
+6
-8
No files matched your search
@@ -87,7 +87,7 @@ test('download progress tracked correctly', () => {
|
|||||||
expect(progress.isDone()).toBe(true)
|
expect(progress.isDone()).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('display timer works correctly', () => {
|
test('display timer works correctly', done => {
|
||||||
const progress = new DownloadProgress(1000)
|
const progress = new DownloadProgress(1000)
|
||||||
|
|
||||||
const infoMock = jest.spyOn(core, 'info')
|
const infoMock = jest.spyOn(core, 'info')
|
||||||
@@ -103,6 +103,7 @@ test('display timer works correctly', () => {
|
|||||||
const test2 = (): void => {
|
const test2 = (): void => {
|
||||||
check()
|
check()
|
||||||
expect(progress.timeoutHandle).toBeUndefined()
|
expect(progress.timeoutHandle).toBeUndefined()
|
||||||
|
done()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the progress is displayed, stop the timer, and call test2.
|
// Validate the progress is displayed, stop the timer, and call test2.
|
||||||
@@ -112,7 +113,7 @@ test('display timer works correctly', () => {
|
|||||||
progress.stopDisplayTimer()
|
progress.stopDisplayTimer()
|
||||||
progress.setReceivedBytes(1000)
|
progress.setReceivedBytes(1000)
|
||||||
|
|
||||||
setTimeout(() => test2(), 100)
|
setTimeout(() => test2(), 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the timer, update the received bytes, and call test1.
|
// Start the timer, update the received bytes, and call test1.
|
||||||
@@ -122,7 +123,7 @@ test('display timer works correctly', () => {
|
|||||||
|
|
||||||
progress.setReceivedBytes(500)
|
progress.setReceivedBytes(500)
|
||||||
|
|
||||||
setTimeout(() => test1(), 100)
|
setTimeout(() => test1(), 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ async function handleResponse(
|
|||||||
response: ITestResponse | undefined
|
response: ITestResponse | undefined
|
||||||
): Promise<ITestResponse> {
|
): Promise<ITestResponse> {
|
||||||
if (!response) {
|
if (!response) {
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
fail('Retry method called too many times')
|
fail('Retry method called too many times')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ beforeAll(() => {
|
|||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
||||||
jest.spyOn(core, 'error').mockImplementation(() => {})
|
jest.spyOn(core, 'error').mockImplementation(() => {})
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
||||||
jest.spyOn(cacheUtils, 'getCacheFileName').mockImplementation(cm => {
|
jest.spyOn(cacheUtils, 'getCacheFileName').mockImplementation(cm => {
|
||||||
const actualUtils = jest.requireActual('../src/internal/cacheUtils')
|
const actualUtils = jest.requireActual('../src/internal/cacheUtils')
|
||||||
return actualUtils.getCacheFileName(cm)
|
return actualUtils.getCacheFileName(cm)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ beforeAll(() => {
|
|||||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
||||||
jest.spyOn(core, 'error').mockImplementation(() => {})
|
jest.spyOn(core, 'error').mockImplementation(() => {})
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
||||||
jest.spyOn(cacheUtils, 'getCacheFileName').mockImplementation(cm => {
|
jest.spyOn(cacheUtils, 'getCacheFileName').mockImplementation(cm => {
|
||||||
const actualUtils = jest.requireActual('../src/internal/cacheUtils')
|
const actualUtils = jest.requireActual('../src/internal/cacheUtils')
|
||||||
return actualUtils.getCacheFileName(cm)
|
return actualUtils.getCacheFileName(cm)
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export class DownloadProgress {
|
|||||||
*
|
*
|
||||||
* @param delayInMs the delay between each write
|
* @param delayInMs the delay between each write
|
||||||
*/
|
*/
|
||||||
startDisplayTimer(delayInMs: number = 1000): void {
|
startDisplayTimer(delayInMs = 1000): void {
|
||||||
const displayCallback = (): void => {
|
const displayCallback = (): void => {
|
||||||
this.display()
|
this.display()
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export async function retryTypedResponse<T>(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function retryHttpClientResponse<T>(
|
export async function retryHttpClientResponse(
|
||||||
name: string,
|
name: string,
|
||||||
method: () => Promise<IHttpClientResponse>,
|
method: () => Promise<IHttpClientResponse>,
|
||||||
maxAttempts = DefaultRetryAttempts,
|
maxAttempts = DefaultRetryAttempts,
|
||||||
|
|||||||
Reference in new issue
Block a user