From 8a8c42ddb2962ab4722774e7b8cc865bbef2b70f Mon Sep 17 00:00:00 2001 From: jw255 Date: Wed, 10 Jan 2018 12:58:28 +0000 Subject: updated readme, todo to explain/include changes. wrote a test for helloworld. all test files need .test.ts extension. --- test/nodeserver.test.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/nodeserver.test.ts (limited to 'test/nodeserver.test.ts') diff --git a/test/nodeserver.test.ts b/test/nodeserver.test.ts new file mode 100644 index 0000000..213b8d0 --- /dev/null +++ b/test/nodeserver.test.ts @@ -0,0 +1,26 @@ +import * as mocha from 'mocha'; +import * as chai from 'chai'; +import chaiHttp = require('chai-http'); + +import app from '../src/app'; + +chai.use(chaiHttp); +const expect = chai.expect; + +describe('baseRoute', () => { + + it('should be json', () => { + return chai.request(app).get('/') + .then(res => { + expect(res.type).to.eql('application/json'); + }); + }); + + it('should have a message prop', () => { + return chai.request(app).get('/') + .then(res => { + expect(res.body.message).to.eql('Hello World!'); + }); + }); + +}); -- cgit v1.2.1