fix(GitHub Node): Tolerate trailing slash in file path (#15517)

This commit is contained in:
Michael Kret
2025-06-17 18:21:57 +03:00
committed by GitHub
parent c64ccf74a2
commit 2f6896cc7b
6 changed files with 93 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import {
fuzzyCompare,
getResolvables,
keysToLowercase,
removeTrailingSlash,
shuffleArray,
sortItemKeysByPriorityList,
wrapData,
@@ -312,3 +313,13 @@ describe('sortItemKeysByPriorityList', () => {
expect(Object.keys(result[0].json)).toEqual(['a', 'b', 'd']);
});
});
describe('removeTrailingSlash', () => {
it('removes trailing slash', () => {
expect(removeTrailingSlash('https://example.com/')).toBe('https://example.com');
});
it('does not change a URL without trailing slash', () => {
expect(removeTrailingSlash('https://example.com')).toBe('https://example.com');
});
});