mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-19 12:54:45 +00:00
Added option to enable corepack (#1)
Co-authored-by: Steven <steven@ceriously.com> Co-authored-by: Sayak Mukhopadhyay <mukhopadhyaysayak@gmail.com> Co-authored-by: Jacob Parish <jacob.parish.1@gmail.com>
This commit is contained in:
parent
5ef044f9d0
commit
2936fe8cda
8 changed files with 132 additions and 15 deletions
|
@ -825,4 +825,36 @@ describe('setup-node', () => {
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('corepack flag', () => {
|
||||
it('use corepack if specified', async () => {
|
||||
inputs['corepack'] = 'true';
|
||||
await main.run();
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'corepack',
|
||||
['enable'],
|
||||
expect.anything()
|
||||
);
|
||||
});
|
||||
|
||||
it('use corepack with given package manager', async () => {
|
||||
inputs['corepack'] = 'npm';
|
||||
await main.run();
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'corepack',
|
||||
['enable', 'npm'],
|
||||
expect.anything()
|
||||
);
|
||||
});
|
||||
|
||||
it('use corepack with multiple package managers', async () => {
|
||||
inputs['corepack'] = 'npm yarn';
|
||||
await main.run();
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'corepack',
|
||||
['enable', 'npm', 'yarn'],
|
||||
expect.anything()
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue