mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 12:54:45 +00:00
feat: allow specifying a version
This commit is contained in:
parent
4478bd4702
commit
aa9724272b
6 changed files with 40 additions and 6 deletions
|
@ -301,10 +301,28 @@ describe('main tests', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should enable corepack when input is "true"', async () => {
|
||||
it('should install latest corepack when input is "true"', async () => {
|
||||
inputs['corepack'] = 'true';
|
||||
await main.run();
|
||||
expect(getCommandOutputSpy).toHaveBeenCalledWith('npm i -g corepack');
|
||||
expect(getCommandOutputSpy).toHaveBeenCalledWith(
|
||||
'npm i -g corepack@latest'
|
||||
);
|
||||
});
|
||||
|
||||
it('should install latest corepack when input is "latest"', async () => {
|
||||
inputs['corepack'] = 'latest';
|
||||
await main.run();
|
||||
expect(getCommandOutputSpy).toHaveBeenCalledWith(
|
||||
'npm i -g corepack@latest'
|
||||
);
|
||||
});
|
||||
|
||||
it('should install a specific version of corepack when specified', async () => {
|
||||
inputs['corepack'] = '0.32.0';
|
||||
await main.run();
|
||||
expect(getCommandOutputSpy).toHaveBeenCalledWith(
|
||||
'npm i -g corepack@0.32.0'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue