DefinitelyTyped/http-assert/http-assert-tests.ts
jKey Lu ced2d7864b Type definitions for http-assert (#13801)
* Type definitions for http-assert

* update http-assert
2017-01-06 08:17:39 -08:00

12 lines
328 B
TypeScript

import * as httpAssert from 'http-assert';
import { HttpError } from 'http-errors';
try {
httpAssert.equal('hello', 'hello');
httpAssert(false, 401, 'authentication failed');
} catch(err) {
console.log((<HttpError>err).status);
console.log((<HttpError>err).message);
console.log((<HttpError>err).expose);
}