mirror of
https://github.com/actions/setup-node
synced 2024-12-22 05:02:42 +00:00
resolve SymbolicLink (#809)
This commit is contained in:
parent
34050076a5
commit
c7a93deeac
5 changed files with 23 additions and 0 deletions
|
@ -23,8 +23,10 @@ describe('cache-utils', () => {
|
|||
let isFeatureAvailable: jest.SpyInstance;
|
||||
let info: jest.SpyInstance;
|
||||
let warningSpy: jest.SpyInstance;
|
||||
let fsRealPathSyncSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
console.log('::stop-commands::stoptoken');
|
||||
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
|
||||
debugSpy = jest.spyOn(core, 'debug');
|
||||
debugSpy.mockImplementation(msg => {});
|
||||
|
@ -35,8 +37,24 @@ describe('cache-utils', () => {
|
|||
isFeatureAvailable = jest.spyOn(cache, 'isFeatureAvailable');
|
||||
|
||||
getCommandOutputSpy = jest.spyOn(utils, 'getCommandOutput');
|
||||
|
||||
fsRealPathSyncSpy = jest.spyOn(fs, 'realpathSync');
|
||||
fsRealPathSyncSpy.mockImplementation(dirName => {
|
||||
return dirName;
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
//jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
console.log('::stoptoken::');
|
||||
jest.restoreAllMocks();
|
||||
}, 100000);
|
||||
|
||||
describe('getPackageManagerInfo', () => {
|
||||
it.each<[string, PackageManagerInfo | null]>([
|
||||
['npm', utils.supportedPackageManagers.npm],
|
||||
|
|
|
@ -95,6 +95,8 @@ describe('setup-node', () => {
|
|||
res = <INodeVersion[]>nodeTestDistRc;
|
||||
} else if (url.includes('/nightly')) {
|
||||
res = <INodeVersion[]>nodeTestDistNightly;
|
||||
} else if (url.includes('/v8-canary')) {
|
||||
res = <INodeVersion[]>nodeV8CanaryTestDist;
|
||||
} else {
|
||||
res = <INodeVersion[]>nodeTestDist;
|
||||
}
|
||||
|
|
1
dist/cache-save/index.js
vendored
1
dist/cache-save/index.js
vendored
|
@ -60556,6 +60556,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||
const existingDirectories = cacheDependenciesPaths
|
||||
.map(path_1.default.dirname)
|
||||
.filter(util_1.unique())
|
||||
.map(dirName => fs_1.default.realpathSync(dirName))
|
||||
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
|
||||
if (!existingDirectories.length)
|
||||
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
||||
|
|
1
dist/setup/index.js
vendored
1
dist/setup/index.js
vendored
|
@ -71343,6 +71343,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||
const existingDirectories = cacheDependenciesPaths
|
||||
.map(path_1.default.dirname)
|
||||
.filter(util_1.unique())
|
||||
.map(dirName => fs_1.default.realpathSync(dirName))
|
||||
.filter(directory => fs_1.default.lstatSync(directory).isDirectory());
|
||||
if (!existingDirectories.length)
|
||||
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
||||
|
|
|
@ -144,6 +144,7 @@ const getProjectDirectoriesFromCacheDependencyPath = async (
|
|||
const existingDirectories: string[] = cacheDependenciesPaths
|
||||
.map(path.dirname)
|
||||
.filter(unique())
|
||||
.map(dirName => fs.realpathSync(dirName))
|
||||
.filter(directory => fs.lstatSync(directory).isDirectory());
|
||||
|
||||
if (!existingDirectories.length)
|
||||
|
|
Loading…
Reference in a new issue