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/hm.js | 9 --------- test/hm.test.ts | 8 ++++++++ test/hm.ts | 8 -------- test/nodeserver.test.ts | 26 ++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 17 deletions(-) delete mode 100644 test/hm.js create mode 100644 test/hm.test.ts delete mode 100644 test/hm.ts create mode 100644 test/nodeserver.test.ts (limited to 'test') diff --git a/test/hm.js b/test/hm.js deleted file mode 100644 index b6cc906..0000000 --- a/test/hm.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const chai_1 = require("chai"); -require("mocha"); -describe('placeholder test', () => { - it('should pass', () => { - chai_1.expect(true).to.equal(true); - }); -}); diff --git a/test/hm.test.ts b/test/hm.test.ts new file mode 100644 index 0000000..e31f356 --- /dev/null +++ b/test/hm.test.ts @@ -0,0 +1,8 @@ +import { expect } from 'chai'; +import 'mocha'; + +describe('placeholder test', () => { + it('should pass', () => { + expect(true).to.equal(true); + }); +}); diff --git a/test/hm.ts b/test/hm.ts deleted file mode 100644 index e31f356..0000000 --- a/test/hm.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { expect } from 'chai'; -import 'mocha'; - -describe('placeholder test', () => { - it('should pass', () => { - expect(true).to.equal(true); - }); -}); 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