diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 7b95c7a1..4ca19561 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -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()', () => {