mirror of
https://github.com/actions/setup-node.git
synced 2025-02-23 21:59:33 +08:00
check failures fix
This commit is contained in:
parent
1b0ef2d227
commit
07b84a2324
|
@ -670,7 +670,6 @@ describe('NightlyNodejs', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const core = require('@actions/core'); // Mock core
|
|
||||||
jest.spyOn(core, 'info').mockImplementation(() => {}); // Mock core.info function
|
jest.spyOn(core, 'info').mockImplementation(() => {}); // Mock core.info function
|
||||||
|
|
||||||
it('logs mirror URL when provided', async () => {
|
it('logs mirror URL when provided', async () => {
|
||||||
|
|
|
@ -560,7 +560,7 @@ describe('setup-node', () => {
|
||||||
const infoSpy = jest.spyOn(core, 'info').mockImplementation(() => {});
|
const infoSpy = jest.spyOn(core, 'info').mockImplementation(() => {});
|
||||||
|
|
||||||
// Expect the function to throw an error due to undefined mirror URL
|
// Expect the function to throw an error due to undefined mirror URL
|
||||||
expect(() => rcBuild.getDistributionMirrorUrl()).toThrowError(
|
expect(() => rcBuild.getDistributionMirrorUrl()).toThrow(
|
||||||
'Mirror URL is undefined. Please provide a valid mirror URL.'
|
'Mirror URL is undefined. Please provide a valid mirror URL.'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
|
@ -100529,13 +100529,12 @@ class OfficialBuilds extends base_distribution_1.default {
|
||||||
throw new Error('Mirror URL is empty. Please provide a valid mirror URL.');
|
throw new Error('Mirror URL is empty. Please provide a valid mirror URL.');
|
||||||
}
|
}
|
||||||
let downloadPath = '';
|
let downloadPath = '';
|
||||||
let toolPath = '';
|
|
||||||
try {
|
try {
|
||||||
core.info(`Attempting to download using mirror URL...`);
|
core.info(`Attempting to download using mirror URL...`);
|
||||||
downloadPath = yield this.downloadFromMirrorURL(); // Attempt to download from the mirror
|
downloadPath = yield this.downloadFromMirrorURL(); // Attempt to download from the mirror
|
||||||
core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath);
|
core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath);
|
||||||
if (downloadPath) {
|
if (downloadPath) {
|
||||||
toolPath = downloadPath;
|
const toolPath = downloadPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
||||||
import {NodeInputs} from '../base-models';
|
import {NodeInputs} from '../base-models';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
export default class NightlyNodejs extends BasePrereleaseNodejs {
|
export default class NightlyNodejs extends BasePrereleaseNodejs {
|
||||||
protected distribution = 'nightly';
|
protected distribution = 'nightly';
|
||||||
|
|
|
@ -22,13 +22,13 @@ export default class OfficialBuilds extends BaseDistribution {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let downloadPath = '';
|
let downloadPath = '';
|
||||||
let toolPath = '';
|
|
||||||
try {
|
try {
|
||||||
core.info(`Attempting to download using mirror URL...`);
|
core.info(`Attempting to download using mirror URL...`);
|
||||||
downloadPath = await this.downloadFromMirrorURL(); // Attempt to download from the mirror
|
downloadPath = await this.downloadFromMirrorURL(); // Attempt to download from the mirror
|
||||||
core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath);
|
core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath);
|
||||||
if (downloadPath) {
|
if (downloadPath) {
|
||||||
toolPath = downloadPath;
|
const toolPath = downloadPath;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.info((err as Error).message);
|
core.info((err as Error).message);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import BaseDistribution from '../base-distribution';
|
import BaseDistribution from '../base-distribution';
|
||||||
import {NodeInputs} from '../base-models';
|
import {NodeInputs} from '../base-models';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
export default class RcBuild extends BaseDistribution {
|
export default class RcBuild extends BaseDistribution {
|
||||||
getDistributionMirrorUrl() {
|
getDistributionMirrorUrl() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user