mirror of
https://github.com/actions/setup-node.git
synced 2025-10-19 16:53:58 +08:00
feat: allow specifying a version
This commit is contained in:
@@ -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'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user