Commits (2)
test('add 1+1', () => {
expect(1+1).toBe(2)
import request from 'supertest'
const express = require('express');
const app = express();
app.set('port', 8888)
describe('Test endpoint(s)', () => {
it('should return a 200 status code', async () => {
request(app)
.get('/mailinglists')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});
});
it('should return a 200 status code', async () => {
request(app)
.get('/projektdaten')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});
});
it('should return a 200 status code', async () => {
request(app)
.get('/projektinformationen')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});
});
it('should return a 200 status code', async () => {
request(app)
.get('/projectoverview?projectID=1')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});
});
})
\ No newline at end of file
import helpers from '../src/utils/helpers'
import gitlab from '../src/controller/gitlab'
import {helpers} from '../src/utils/helpers'
import {gitlab} from '../src/controller/gitlab'
test('[/utils/helpers] convert string to array', () => {
expect(helpers.stringToArray('foo')).toStrictEqual(["foo"])
......@@ -14,5 +14,5 @@ test('[/controller/gitlab] get projects from gitlab', async () => {
test('[/controller/gitlab] get latest pipeline status from gitlab', async () => {
expect(await gitlab.getLatestPipelineStatus(97)).toBe("success")
expect(await gitlab.getLatestPipelineStatus(0)).toBeUndefined
expect(await gitlab.getLatestPipelineStatus(0)).toBeFalsy
})
\ No newline at end of file
This diff is collapsed.
import https from 'https'
import {helpers} from '../utils/helpers'
import {gitlab} from './gitlab'
import {dbconn} from '../config/dbconn'
import { helpers } from '../utils/helpers'
import { gitlab } from './gitlab'
import { dbconn } from '../config/dbconn'
const lang = 'DE'
......@@ -239,4 +239,4 @@ const controller = {
}
}
export {controller}
export { controller }
......@@ -37,8 +37,8 @@ const gitlab = {
url: 'https://transfer.hft-stuttgart.de/gitlab/api/v4/projects/' + String(projectId) + '/pipelines'
})
.then(res => res.data[0].status)
.catch(err => console.error(err))
.catch(err => console.error(err.response))
}
}
export {gitlab}
export { gitlab }
import {controller} from '../controller/controller'
import { controller } from '../controller/controller'
module.exports = function (app: any) {
// ======== APP ROUTES - PROJECT ====================
// ======== APP ROUTES - PROJECT ====================
app.get('/', function (req: any, res: any) {
controller.showHome(res)
......
......@@ -5,4 +5,4 @@ const helpers = {
}
}
export {helpers}
export { helpers }