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