fake gitlab API more precisely

This allows this suite to detect when an unexpected path is passed to
the projects API.

Signed-off-by: Jamie Klassen <jklassen@vmware.com>
This commit is contained in:
Jamie Klassen
2022-07-21 10:53:32 -04:00
parent 1de2669c91
commit 56a8ff12fd
+4 -1
View File
@@ -28,7 +28,10 @@ describe('gitlab core', () => {
beforeEach(() => {
worker.use(
rest.get('*/api/v4/projects/:name', (_, res, ctx) =>
rest.get('*/api/v4/projects/group%2Fproject', (_, res, ctx) =>
res(ctx.status(200), ctx.json({ id: 12345 })),
),
rest.get('*/api/v4/projects/group%2Fsubgroup%2Fproject', (_, res, ctx) =>
res(ctx.status(200), ctx.json({ id: 12345 })),
),
);