mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
Update tests
This commit is contained in:
parent
8f9fe012e3
commit
2ebb54b081
3 changed files with 9 additions and 7 deletions
|
@ -41,7 +41,6 @@ describe('setup-node', () => {
|
|||
let parseNodeVersionSpy: jest.SpyInstance;
|
||||
let isCacheActionAvailable: jest.SpyInstance;
|
||||
let getExecOutputSpy: jest.SpyInstance;
|
||||
let execExecSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
// @actions/core
|
||||
|
@ -58,7 +57,6 @@ describe('setup-node', () => {
|
|||
archSpy = jest.spyOn(osm, 'arch');
|
||||
archSpy.mockImplementation(() => os['arch']);
|
||||
execSpy = jest.spyOn(cp, 'execSync');
|
||||
execExecSpy = jest.spyOn(exec, 'exec');
|
||||
|
||||
// @actions/tool-cache
|
||||
findSpy = jest.spyOn(tc, 'find');
|
||||
|
@ -251,18 +249,21 @@ describe('setup-node', () => {
|
|||
|
||||
let expPath = path.join(toolPath, 'bin');
|
||||
|
||||
expect(execExecSpy).toHaveBeenCalledWith('node', ['--version']);
|
||||
expect(execExecSpy).toHaveBeenCalledWith(
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'node',
|
||||
['--version'],
|
||||
expect.anything()
|
||||
);
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'npm',
|
||||
['--version'],
|
||||
expect.anything()
|
||||
);
|
||||
expect(execExecSpy).toHaveBeenCalledWith(
|
||||
expect(getExecOutputSpy).toHaveBeenCalledWith(
|
||||
'yarn',
|
||||
['--version'],
|
||||
expect.anything()
|
||||
);
|
||||
|
||||
expect(dlSpy).toHaveBeenCalled();
|
||||
expect(exSpy).toHaveBeenCalled();
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
|
|
1
dist/setup/index.js
vendored
1
dist/setup/index.js
vendored
|
@ -71906,6 +71906,7 @@ function printEnvDetailsAndSetOutput() {
|
|||
core.endGroup();
|
||||
});
|
||||
}
|
||||
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
||||
function getToolVersion(tool, options) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
|
|
|
@ -99,7 +99,7 @@ function resolveVersionInput(): string {
|
|||
return version;
|
||||
}
|
||||
|
||||
async function printEnvDetailsAndSetOutput() {
|
||||
export async function printEnvDetailsAndSetOutput() {
|
||||
core.startGroup('Environment details');
|
||||
|
||||
const promises = ['node', 'npm', 'yarn'].map(async tool => {
|
||||
|
|
Loading…
Add table
Reference in a new issue