From 3a2254185e3929cf7c95c4a4c5455dd3a10f792e Mon Sep 17 00:00:00 2001 From: Jamie Klassen Date: Thu, 21 Jul 2022 11:16:28 -0400 Subject: [PATCH] add coverage for "blob" folder edge case Signed-off-by: Jamie Klassen --- packages/integration/src/gitlab/core.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/integration/src/gitlab/core.test.ts b/packages/integration/src/gitlab/core.test.ts index de785fb41d..0dae905ce4 100644 --- a/packages/integration/src/gitlab/core.test.ts +++ b/packages/integration/src/gitlab/core.test.ts @@ -69,6 +69,16 @@ describe('gitlab core', () => { ).resolves.toBe(fetchUrl); }); + it('supports folder named "blob"', async () => { + const target = + 'https://gitlab.com/group/project/-/blob/branch/blob/file.yaml'; + const fetchUrl = + 'https://gitlab.com/api/v4/projects/12345/repository/files/blob%2Ffile.yaml/raw?ref=branch'; + await expect( + getGitLabFileFetchUrl(target, configWithNoToken), + ).resolves.toBe(fetchUrl); + }); + it('locates projects in subgroups', async () => { const target = 'https://gitlab.com/group/subgroup/project/-/blob/branch/folder/file.yaml';