import { helpers } from '../built/utils/helpers' import { gitlab } from '../built/controller/gitlab' test('[/utils/helpers] convert string to array', () => { expect(helpers.stringToArray('foo')).toStrictEqual(['foo']) expect(helpers.stringToArray('foo,bar')).toStrictEqual(['foo', 'bar']) expect(helpers.stringToArray('')).toBeNull expect(helpers.stringToArray(String(null))).toBeNull }) test('[/controller/gitlab] get projects from gitlab', async () => { expect(await gitlab.getProjects(100, 0)).not.toBeNull }) test('[/controller/gitlab] get latest pipeline status from gitlab', async () => { expect(await gitlab.getLatestPipelineStatus(97)).toBe('success') expect(await gitlab.getLatestPipelineStatus(0)).toBeFalsy })