Archived
2
This commit is contained in:
vle2fe
2020-01-14 13:25:13 +01:00
parent 4d3e1bd0ac
commit 918e337a2a
9 changed files with 2558 additions and 0 deletions

19
src/routes/root.spec.ts Normal file
View File

@ -0,0 +1,19 @@
import supertest from 'supertest';
import should from 'should/as-function';
let server = supertest.agent('http://localhost:3000');
describe('Testing /', () => {
it('returns the message object', done => {
server
.get('/')
.expect('Content-type', /json/)
.expect(200)
.end(function(err, res) {
should(res.statusCode).equal(200);
should(res.body).be.eql({message: 'API server up and running!'});
done();
});
});
});

9
src/routes/root.ts Normal file
View File

@ -0,0 +1,9 @@
import express from 'express';
const router = express.Router();
router.get('/', (req, res) => {
res.json({message: 'API server up and running!'});
});
module.exports = router;