mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-24 05:29:26 +08:00
Fix the major update packages including Jest. (#414)
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
This commit is contained in:
@@ -9,7 +9,9 @@ describe('docker utilities', () => {
|
||||
expect(() => checkDockerPath()).not.toThrow()
|
||||
|
||||
// docker not installed
|
||||
jest.spyOn(io, 'which').mockImplementationOnce(async () => undefined)
|
||||
jest.spyOn(io, 'which').mockImplementationOnce(async () => {
|
||||
throw new Error('not found')
|
||||
})
|
||||
await expect(() => checkDockerPath()).rejects.toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('File utils', () => {
|
||||
|
||||
expect(
|
||||
fileUtils.getFilesFromDirectoriesAndURLs([badPath, goodPath])
|
||||
).rejects.toThrowError()
|
||||
).rejects.toThrow()
|
||||
})
|
||||
|
||||
it("doesn't duplicate files when nested dir included", async () => {
|
||||
|
||||
@@ -42,20 +42,20 @@ describe('Kubectl utils', () => {
|
||||
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
||||
let warningCalls = 0
|
||||
expect(() => checkForErrors([success], true)).not.toThrow()
|
||||
expect(core.warning).toBeCalledTimes(warningCalls)
|
||||
expect(core.warning).toHaveBeenCalledTimes(warningCalls)
|
||||
|
||||
expect(() => checkForErrors([successWithStderr], true)).not.toThrow()
|
||||
expect(core.warning).toBeCalledTimes(++warningCalls)
|
||||
expect(core.warning).toHaveBeenCalledTimes(++warningCalls)
|
||||
|
||||
expect(() =>
|
||||
checkForErrors([success, successWithStderr], true)
|
||||
).not.toThrow()
|
||||
expect(core.warning).toBeCalledTimes(++warningCalls)
|
||||
expect(core.warning).toHaveBeenCalledTimes(++warningCalls)
|
||||
|
||||
expect(() => checkForErrors([failWithExitCode], true)).not.toThrow()
|
||||
expect(core.warning).toBeCalledTimes(++warningCalls)
|
||||
expect(core.warning).toHaveBeenCalledTimes(++warningCalls)
|
||||
|
||||
expect(() => checkForErrors([failWithExitWithStderr], true)).not.toThrow()
|
||||
expect(core.warning).toBeCalledTimes(++warningCalls)
|
||||
expect(core.warning).toHaveBeenCalledTimes(++warningCalls)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user