Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('setup-node', () => {
});
warningSpy.mockImplementation(msg => {
// uncomment to debug
// process.stderr.write('log:' + line + '\n');
// process.stderr.write('log:' + msg + '\n');
});
});

Expand Down Expand Up @@ -909,4 +909,22 @@ describe('setup-node', () => {
);
});
});

describe('corepack', () => {
it('supports pnpm automatically from Node v14+', async () => {
inputs['node-version'] = '14.19.0';
inputs['cache'] = 'pnpm';

inSpy.mockImplementation(name => inputs[name]);

isCacheActionAvailable.mockImplementation(() => true);

const toolPath = path.normalize('/cache/node/14.19.0/x64');
findSpy.mockReturnValue(toolPath);

await main.run();

expect(cnSpy).toHaveBeenNthCalledWith(2, `[command]${process.execPath.substring(0, process.execPath.length - 4)}corepack enable\n`);
})
})
});
Loading