File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ module.exports = function (chai, _) {
77
77
*/
78
78
79
79
Assertion . addMethod ( 'status' , function ( code ) {
80
- new Assertion ( this . _obj ) . to . have . property ( 'status' ) ;
81
- var status = this . _obj . status ;
80
+ new Assertion ( this . _obj ) . to . have . any . keys ( 'status' , 'statusCode ') ;
81
+ var status = this . _obj . status || this . _obj . statusCode ;
82
82
83
83
this . assert (
84
84
status == code
Original file line number Diff line number Diff line change 1
1
describe ( 'assertions' , function ( ) {
2
2
3
- it ( '#status' , function ( ) {
3
+ it ( '#status property "status" ' , function ( ) {
4
4
var res = { status : 200 } ;
5
5
res . should . to . have . status ( 200 ) ;
6
6
@@ -10,7 +10,12 @@ describe('assertions', function () {
10
10
11
11
( function ( ) {
12
12
( { } ) . should . not . to . have . status ( 200 ) ;
13
- } ) . should . throw ( "expected {} to have a property 'status'" ) ;
13
+ } ) . should . throw ( "expected {} to have keys 'status', or 'statusCode'" ) ;
14
+ } ) ;
15
+
16
+ it ( '#status property "statusCode"' , function ( ) {
17
+ var res = { statusCode : 200 } ;
18
+ res . should . to . have . status ( 200 ) ;
14
19
} ) ;
15
20
16
21
it ( '#ip' , function ( ) {
You can’t perform that action at this time.
0 commit comments