From 9f0fa37d99e275bdab0e6b9fe1bf8f280aa9e7b8 Mon Sep 17 00:00:00 2001 From: Christian Bargmann Date: Fri, 23 Jun 2023 16:05:02 +0200 Subject: [PATCH] fix: tests, add marcelmindemann as CODEOWNER (#16) * fix: tests * fix: paths * add marcelmindemann as CODEOWNER --- CODEOWNERS | 2 +- __tests__/run.test.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index a9a29ab..6264db1 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -6,4 +6,4 @@ # the repo. Unless a later match takes precedence, # mentioned account names will be requested for # review when someone opens a pull request. -* @msiuts @snowiow @guusvw @djablonski-moia @oppermax @cbrgm +* @msiuts @snowiow @guusvw @djablonski-moia @oppermax @cbrgm @marcelmindemann diff --git a/__tests__/run.test.ts b/__tests__/run.test.ts index 265e6d7..0fa91c8 100644 --- a/__tests__/run.test.ts +++ b/__tests__/run.test.ts @@ -53,7 +53,7 @@ describe('Testing all functions in run file.', () => { ['amd64'] ])('getEksctlDownloadURL() must return the URL to download %s eksctl for Linux based systems', (arch) => { jest.spyOn(os, 'type').mockReturnValue('Linux'); - const eksctlLinuxUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/0.57.0/eksctl_Linux_%s.tar.gz', arch); + const eksctlLinuxUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/v0.57.0/eksctl_Linux_%s.tar.gz', arch); expect(run.getEksctlDownloadURL('0.57.0', arch)).toBe(eksctlLinuxUrl); expect(os.type).toBeCalled(); @@ -65,7 +65,7 @@ describe('Testing all functions in run file.', () => { ['amd64'] ])('getEksctlDownloadURL() must return the URL to download %s eksctl for MacOS based systems', (arch) => { jest.spyOn(os, 'type').mockReturnValue('Darwin'); - const eksctlDarwinUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/0.57.0/eksctl_Darwin_%s.tar.gz', arch); + const eksctlDarwinUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/v0.57.0/eksctl_Darwin_%s.tar.gz', arch); expect(run.getEksctlDownloadURL('0.57.0', arch)).toBe(eksctlDarwinUrl); expect(os.type).toBeCalled(); @@ -77,7 +77,7 @@ describe('Testing all functions in run file.', () => { ['amd64'] ])('getEksctlDownloadURL() must return the URL to download %s eksctl for Windows based systems', (arch) => { jest.spyOn(os, 'type').mockReturnValue('Windows_NT'); - const eksctlWindowsUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/0.57.0/eksctl_Windows_%s.zip', arch); + const eksctlWindowsUrl = util.format('https://github.com/weaveworks/eksctl/releases/download/v0.57.0/eksctl_Windows_%s.zip', arch); expect(run.getEksctlDownloadURL('0.57.0', arch)).toBe(eksctlWindowsUrl); expect(os.type).toBeCalled(); @@ -87,10 +87,10 @@ describe('Testing all functions in run file.', () => { jest.spyOn(toolCache, 'find').mockReturnValue(''); jest.spyOn(toolCache, 'downloadTool').mockReturnValue(Promise.resolve('eksctlDownloadPath')); jest.spyOn(toolCache, 'extractTar').mockReturnValue(Promise.resolve('eksctlExtractedFolder')); - + jest.spyOn(toolCache, 'cacheDir').mockReturnValue(Promise.resolve('pathToCachedTool')); jest.spyOn(os, 'type').mockReturnValue('Linux'); - jest.spyOn(fs, 'chmodSync').mockImplementation(() => {}); + jest.spyOn(fs, 'chmodSync').mockImplementation(() => { }); expect(await run.downloadEksctl('0.57.0')).toBe(path.join('pathToCachedTool', 'eksctl')); expect(toolCache.find).toBeCalledWith('eksctl', '0.57.0'); @@ -104,10 +104,10 @@ describe('Testing all functions in run file.', () => { jest.spyOn(toolCache, 'find').mockReturnValue(''); jest.spyOn(toolCache, 'downloadTool').mockReturnValue(Promise.resolve('eksctlDownloadPath')); jest.spyOn(toolCache, 'extractZip').mockReturnValue(Promise.resolve('eksctlExtractedFolder')); - + jest.spyOn(toolCache, 'cacheDir').mockReturnValue(Promise.resolve('pathToCachedTool')); jest.spyOn(os, 'type').mockReturnValue('Windows_NT'); - jest.spyOn(fs, 'chmodSync').mockImplementation(() => {}); + jest.spyOn(fs, 'chmodSync').mockImplementation(() => { }); expect(await run.downloadEksctl('0.57.0')).toBe(path.join('pathToCachedTool', 'eksctl.exe')); expect(toolCache.find).toBeCalledWith('eksctl', '0.57.0'); @@ -136,4 +136,4 @@ describe('Testing all functions in run file.', () => { expect(toolCache.downloadTool).toBeCalled(); expect(fs.readFileSync).toBeCalledWith('pathToTool', 'utf8'); }); -}) \ No newline at end of file +})