diff options
| author | jw255 | 2018-01-10 12:58:28 +0000 |
|---|---|---|
| committer | jw255 | 2018-01-10 12:58:28 +0000 |
| commit | 8a8c42ddb2962ab4722774e7b8cc865bbef2b70f (patch) | |
| tree | cd5a20138c05e0135febf875f36de0173d7f89fd /test | |
| parent | modified README and made a script to install all packages, compile ts and run... (diff) | |
| download | medicine-8a8c42ddb2962ab4722774e7b8cc865bbef2b70f.tar.gz medicine-8a8c42ddb2962ab4722774e7b8cc865bbef2b70f.zip | |
updated readme, todo to explain/include changes. wrote a test for helloworld. all test files need .test.ts extension.
Diffstat (limited to 'test')
| -rw-r--r-- | test/hm.js | 9 | ||||
| -rw-r--r-- | test/hm.test.ts (renamed from test/hm.ts) | 0 | ||||
| -rw-r--r-- | test/nodeserver.test.ts | 26 |
3 files changed, 26 insertions, 9 deletions
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.ts b/test/hm.test.ts index e31f356..e31f356 100644 --- a/test/hm.ts +++ b/test/hm.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!'); + }); + }); + +}); |
