mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-18 01:12:35 +00:00
default behaviour
This commit is contained in:
parent
102cb0066b
commit
c7f7145902
1 changed files with 37 additions and 0 deletions
|
|
@ -743,4 +743,41 @@ describe('Setup Terraform', () => {
|
|||
const versionObj = await setup();
|
||||
expect(versionObj.version).toEqual('0.1.0');
|
||||
});
|
||||
|
||||
test('gets latest version using empty inputs for versions', async () => {
|
||||
const version = '';
|
||||
const versionFile = '';
|
||||
const credentialsHostname = 'app.terraform.io';
|
||||
const credentialsToken = 'asdfjkl';
|
||||
|
||||
core.getInput = jest
|
||||
.fn()
|
||||
.mockReturnValueOnce(version)
|
||||
.mockReturnValueOnce(versionFile)
|
||||
.mockReturnValueOnce(credentialsHostname)
|
||||
.mockReturnValueOnce(credentialsToken);
|
||||
|
||||
tc.downloadTool = jest
|
||||
.fn()
|
||||
.mockReturnValueOnce('file.zip');
|
||||
|
||||
tc.extractZip = jest
|
||||
.fn()
|
||||
.mockReturnValueOnce('file');
|
||||
|
||||
os.platform = jest
|
||||
.fn()
|
||||
.mockReturnValue('linux');
|
||||
|
||||
os.arch = jest
|
||||
.fn()
|
||||
.mockReturnValue('amd64');
|
||||
|
||||
nock('https://releases.hashicorp.com')
|
||||
.get('/terraform/index.json')
|
||||
.reply(200, json);
|
||||
|
||||
const versionObj = await setup();
|
||||
expect(versionObj.version).toEqual('0.10.0');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue