test: Add not to be cases

This commit is contained in:
peaceiris 2019-12-08 15:31:20 +09:00
parent 2b2ecc2dd1
commit 7c7d22c0de
2 changed files with 3 additions and 9 deletions

View file

@ -8,9 +8,6 @@ describe('getOS', () => {
}); });
test('test exception', () => { test('test exception', () => {
// expect(() => {
// getOS("win32");
// }).toThrowError("Windows is not supported");
expect(() => { expect(() => {
getOS('centos'); getOS('centos');
}).toThrowError('centos is not supported'); }).toThrowError('centos is not supported');

View file

@ -9,14 +9,11 @@ describe('getURL()', () => {
const urlMacOS = `${baseURL}/hugo_0.58.2_macOS-64bit.tar.gz`; const urlMacOS = `${baseURL}/hugo_0.58.2_macOS-64bit.tar.gz`;
const urlWindows = `${baseURL}/hugo_0.58.2_Windows-64bit.zip`; const urlWindows = `${baseURL}/hugo_0.58.2_Windows-64bit.zip`;
expect(getURL('Linux', 'false', '0.58.2')).toBe(urlLinux); 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('Linux', 'true', '0.58.2')).toBe(urlLinuxExtended);
expect(getURL('macOS', 'false', '0.58.2')).toBe(urlMacOS); expect(getURL('macOS', 'false', '0.58.2')).toBe(urlMacOS);
expect(getURL('Windows', 'false', '0.58.2')).toBe(urlWindows); expect(getURL('Windows', 'false', '0.58.2')).toBe(urlWindows);
}); });
// test("test exception", () => {
// expect(() => {
// getURL("Linux", "hoge", "0.58.2");
// }).toThrowError("Invalid input (extended): hoge");
// });
}); });