File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -759,6 +759,25 @@ describe('request(app)', function () {
759759 } ) ;
760760 } ) ;
761761
762+ // this scenario should never happen after https://github.com/visionmedia/supertest/pull/767
763+ // meant for test coverage for lib/test.js#287
764+ // https://github.com/visionmedia/supertest/blob/e064b5ae71e1dfa3e1a74745fda527ac542e1878/lib/test.js#L287
765+ it ( '_assertFunction should catch and return error' , function ( done ) {
766+ const error = new Error ( 'failed' ) ;
767+ const returnedError = get
768+ // private api
769+ . _assertFunction ( function ( res ) {
770+ throw error ;
771+ } ) ;
772+ get
773+ . end ( function ( ) {
774+ returnedError . should . equal ( error ) ;
775+ returnedError . message . should . equal ( 'failed' ) ;
776+ shouldIncludeStackWithThisFile ( returnedError ) ;
777+ done ( ) ;
778+ } ) ;
779+ } ) ;
780+
762781 it (
763782 'ensures truthy non-errors returned from asserts are not promoted to errors' ,
764783 function ( done ) {
You can’t perform that action at this time.
0 commit comments