diff options
| author | jw255 | 2018-02-24 17:13:43 +0000 |
|---|---|---|
| committer | jw255 | 2018-02-24 17:13:43 +0000 |
| commit | f66a9fa7f132f41b2e40029f0fb535521c3fb716 (patch) | |
| tree | 31c7a774d656ef833254e48ef3bfc86a2af8a73a /test/integration/auth.routes.test.ts | |
| parent | restructuring of tests (diff) | |
| download | medicine-f66a9fa7f132f41b2e40029f0fb535521c3fb716.tar.gz medicine-f66a9fa7f132f41b2e40029f0fb535521c3fb716.zip | |
restructuring of tests + yarn install script
Diffstat (limited to 'test/integration/auth.routes.test.ts')
| -rw-r--r-- | test/integration/auth.routes.test.ts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/integration/auth.routes.test.ts b/test/integration/auth.routes.test.ts new file mode 100644 index 0000000..edfbd0a --- /dev/null +++ b/test/integration/auth.routes.test.ts @@ -0,0 +1,42 @@ +/* tslint:disable:newline-per-chained-call */ +/* Chai assertions look silly when formatted multiline. */ +/* tslint:disable:no-unused-expression */ +/* Chai assertions do not require assignation. */ + +import * as chai from 'chai'; +const expect: Chai.ExpectStatic = chai.expect; + +// Chai-http must be imported this way: +// tslint:disable-next-line:no-var-requires no-require-imports +chai.use(require('chai-http')); + +// Mocha must be imported as a side-effect library: +// tslint:disable-next-line:no-import-side-effect +import 'mocha'; + +import * as App from '../../src/app'; +let app = App.TestApp(); + +describe('baseRoute', () => { + it('should be json', () => { + return chai.request(app).get('/') + .then((res: ChaiHttp.Response) => { + expect(res.type).to.eql('application/json'); + }); + }); + + it('should have a message prop', () => { + return chai.request(app).get('/') + .then((res: ChaiHttp.Response) => { + expect(res.body.message).to.eql('Welcome to the CS3099 BE4 server!'); + }); + }); + + it('should have an important prop', () => { + return chai.request(app).get('/') + .then((res: ChaiHttp.Response) => { + expect(res.body.important).to.eql('Endpoints start from /cs3099group-be-4/'); + }); + }); + +});
\ No newline at end of file |
