format: run npm format task

This commit is contained in:
peaceiris 2019-09-21 10:00:59 +09:00
parent 7e7e0130d0
commit 4e3dcc4c49
7 changed files with 52 additions and 52 deletions

View file

@ -1,18 +1,18 @@
import getOS from "../src/get-os";
import getOS from '../src/get-os';
describe("getOS", () => {
test("test", () => {
expect(getOS("linux")).toBe("Linux");
expect(getOS("darwin")).toBe("macOS");
expect(getOS("win32")).toBe("Windows");
describe('getOS', () => {
test('test', () => {
expect(getOS('linux')).toBe('Linux');
expect(getOS('darwin')).toBe('macOS');
expect(getOS('win32')).toBe('Windows');
});
test("test exception", () => {
test('test exception', () => {
// expect(() => {
// getOS("win32");
// }).toThrowError("Windows is not supported");
expect(() => {
getOS("centos");
}).toThrowError("centos is not supported");
getOS('centos');
}).toThrowError('centos is not supported');
});
});

View file

@ -1,17 +1,17 @@
import getURL from "../src/get-url";
import getURL from '../src/get-url';
describe("getURL()", () => {
test("test", () => {
describe('getURL()', () => {
test('test', () => {
const baseURL =
"https://github.com/gohugoio/hugo/releases/download/v0.58.2";
'https://github.com/gohugoio/hugo/releases/download/v0.58.2';
const urlLinux = `${baseURL}/hugo_0.58.2_Linux-64bit.tar.gz`;
const urlLinuxExtended = `${baseURL}/hugo_extended_0.58.2_Linux-64bit.tar.gz`;
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")).toBe(urlLinuxExtended);
expect(getURL("macOS", "false", "0.58.2")).toBe(urlMacOS);
expect(getURL("Windows", "false", "0.58.2")).toBe(urlWindows);
expect(getURL('Linux', 'false', '0.58.2')).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", () => {