const gc = require('../src/controller/gitlabController') describe('GitLab API', () => { test('returns an existing gitlab user by an email address', async () => { const user = await gc.gitlabController.getUserByEmail('litehon958@whipjoy.com') expect(user).not.toBeNull() }) test('returns an undefined user', async () => { const user = await gc.gitlabController.getUserByEmail('johndoe@nowhere.com') expect(user).toBeUndefined() }) test('returns users project', async () => { const userProjects = await gc.gitlabController.getUserProjects(136) expect(userProjects).toBeDefined() }) test('returns null, due to non-existing gitlab user ID', async () => { const userProjects = await gc.gitlabController.getUserProjects(0) expect(userProjects).toBeNull() }) test('returns a project by ID', async () => { const project = await gc.gitlabController.getProjectById(13) // m4lab_landing_page expect(project).toBeDefined() }) test('returns undefined, due to invalid project ID', async () => { const project = await gc.gitlabController.getProjectById(0) expect(project).toBeNull() }) })