Skip to content

Commit

Permalink
test: Add test for extended option (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Jan 18, 2020
1 parent 8323a17 commit 6281061
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ describe('Integration testing run()', () => {
expect(result.output).toMatch(`Hugo Static Site Generator v${testVersion}`);
});

test('succeed in installing a custom extended version', async () => {
const testVersion = Tool.TestVersionSpec;
process.env['INPUT_HUGO-VERSION'] = testVersion;
process.env['INPUT_EXTENDED'] = 'true';
const result: main.ActionResult = await main.run();
expect(result.exitcode).toBe(0);
expect(result.output).toMatch(`Hugo Static Site Generator v${testVersion}`);
expect(result.output).toMatch(`extended`);
});

test('succeed in installing the latest version', async () => {
const testVersion = 'latest';
process.env['INPUT_HUGO-VERSION'] = testVersion;
Expand All @@ -44,6 +54,21 @@ describe('Integration testing run()', () => {
`Hugo Static Site Generator v${Tool.TestVersionLatest}`
);
});

test('succeed in installing the latest extended version', async () => {
const testVersion = 'latest';
process.env['INPUT_HUGO-VERSION'] = testVersion;
process.env['INPUT_EXTENDED'] = 'true';
nock('https://formulae.brew.sh')
.get(`/api/formula/${Tool.Repo}.json`)
.reply(200, jsonTestBrew);
const result: main.ActionResult = await main.run();
expect(result.exitcode).toBe(0);
expect(result.output).toMatch(
`Hugo Static Site Generator v${Tool.TestVersionLatest}`
);
expect(result.output).toMatch(`extended`);
});
});

describe('showVersion()', () => {
Expand Down

0 comments on commit 6281061

Please sign in to comment.