init
This commit is contained in:
		
							
								
								
									
										19
									
								
								src/routes/root.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/routes/root.spec.ts
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										9
									
								
								src/routes/root.ts
									
									
									
									
									
										Normal 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;
 | 
			
		||||
		Reference in New Issue
	
	Block a user