mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-24 02:37:29 +01:00
Feat: Support macOS and Windows, migrate JavaScript to TypeScript (#32)
- Support macOS and Windows (Close #24 ) - Refactoring - Error handling - TypeScript - Prettier (Close #29 ) - GHA: Add upload-artifact step for test coverage - deps: Install husky
This commit is contained in:
22
__tests__/get-url.test.ts
Normal file
22
__tests__/get-url.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import getURL from '../src/get-url';
|
||||
|
||||
describe('getURL()', () => {
|
||||
test('test', () => {
|
||||
const baseURL =
|
||||
'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);
|
||||
});
|
||||
|
||||
// test("test exception", () => {
|
||||
// expect(() => {
|
||||
// getURL("Linux", "hoge", "0.58.2");
|
||||
// }).toThrowError("Invalid input (extended): hoge");
|
||||
// });
|
||||
});
|
||||
Reference in New Issue
Block a user