test: Add test for extended option (#134)

This commit is contained in:
Shohei Ueda 2020-01-18 12:33:56 +09:00 committed by GitHub
parent 8323a17f96
commit 6281061c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
@ -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()', () => {