From 7c7d22c0dec147e541b465beadfb844539d84d04 Mon Sep 17 00:00:00 2001 From: peaceiris <30958501+peaceiris@users.noreply.github.com> Date: Sun, 8 Dec 2019 15:31:20 +0900 Subject: [PATCH] test: Add not to be cases --- __tests__/get-os.test.ts | 3 --- __tests__/get-url.test.ts | 9 +++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/__tests__/get-os.test.ts b/__tests__/get-os.test.ts index d30e939..da4dad9 100644 --- a/__tests__/get-os.test.ts +++ b/__tests__/get-os.test.ts @@ -8,9 +8,6 @@ describe('getOS', () => { }); test('test exception', () => { - // expect(() => { - // getOS("win32"); - // }).toThrowError("Windows is not supported"); expect(() => { getOS('centos'); }).toThrowError('centos is not supported'); diff --git a/__tests__/get-url.test.ts b/__tests__/get-url.test.ts index 118a8f2..09bffe0 100644 --- a/__tests__/get-url.test.ts +++ b/__tests__/get-url.test.ts @@ -9,14 +9,11 @@ describe('getURL()', () => { const urlMacOS = `${baseURL}/hugo_0.58.2_macOS-64bit.tar.gz`; const urlWindows = `${baseURL}/hugo_0.58.2_Windows-64bit.zip`; expect(getURL('Linux', 'false', '0.58.2')).toBe(urlLinux); + expect(getURL('Linux', 'true', '0.58.2')).not.toBe(urlLinux); + expect(getURL('MyOS', 'false', '0.58.2')).not.toBe(urlLinux); + expect(getURL('Linux', 'false', '0.58.1')).not.toBe(urlLinux); expect(getURL('Linux', 'true', '0.58.2')).toBe(urlLinuxExtended); expect(getURL('macOS', 'false', '0.58.2')).toBe(urlMacOS); expect(getURL('Windows', 'false', '0.58.2')).toBe(urlWindows); }); - - // test("test exception", () => { - // expect(() => { - // getURL("Linux", "hoge", "0.58.2"); - // }).toThrowError("Invalid input (extended): hoge"); - // }); });