diff options
| author | jw255 | 2018-03-05 17:57:19 +0000 |
|---|---|---|
| committer | jw255 | 2018-03-05 17:57:19 +0000 |
| commit | dfa461025cece1c17d70f0763848ab434a62ed8d (patch) | |
| tree | 15d78b6dbd21f23a9197301bf9ec6274111d6231 /src/errors | |
| parent | fixed authentication and DB initialisation (diff) | |
| download | medicine-dfa461025cece1c17d70f0763848ab434a62ed8d.tar.gz medicine-dfa461025cece1c17d70f0763848ab434a62ed8d.zip | |
authentication tests in progress
Diffstat (limited to 'src/errors')
| -rw-r--r-- | src/errors/errorware.test.ts | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/errors/errorware.test.ts b/src/errors/errorware.test.ts deleted file mode 100644 index eb85cc6..0000000 --- a/src/errors/errorware.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* tslint:disable:no-unused-expression */ -// Disabled to allow chai-style assertions. - -import * as chai from 'chai'; -chai.should(); - -import { ErrorResponseBlock, RequestError } from './errorware'; - -describe('RequestError', () => { - describe('constructor', () => { - it('constructs simple errors', () => { - const err: RequestError = new RequestError( - 404, 'user_not_found' - ); - err.code.should.equal(404); - err.name.should.equal('user_not_found'); - }); - it('constructs with sensible defaults', () => { - const err: RequestError = new RequestError(); - err.code.should.not.be.undefined; - err.name.should.not.be.undefined; - }); - }); - describe('response generation', () => { - it('generates responses', () => { - const err: RequestError = new RequestError( - 500, 'internal_server_error' - ); - const response: ErrorResponseBlock = - err.responseBlock(); - response.status.should.equal('error'); - response.error.should.equal('internal_server_error'); - }); - }); -}); |
