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