File tree 3 files changed +33
-1
lines changed
3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -1016,7 +1016,10 @@ module.exports = function (chai, _) {
1016
1016
if ( msg ) flag ( this , 'message' , msg ) ;
1017
1017
var obj = flag ( this , 'object' ) ;
1018
1018
if ( flag ( this , 'deep' ) ) {
1019
- return this . eql ( val ) ;
1019
+ var prevLockSsfi = flag ( this , 'lockSsfi' ) ;
1020
+ flag ( this , 'lockSsfi' , true ) ;
1021
+ this . eql ( val ) ;
1022
+ flag ( this , 'lockSsfi' , prevLockSsfi ) ;
1020
1023
} else {
1021
1024
this . assert (
1022
1025
val === obj
Original file line number Diff line number Diff line change @@ -1181,6 +1181,22 @@ describe('expect', function () {
1181
1181
it ( 'deep.equal(val)' , function ( ) {
1182
1182
expect ( { foo : 'bar' } ) . to . deep . equal ( { foo : 'bar' } ) ;
1183
1183
expect ( { foo : 'bar' } ) . not . to . deep . equal ( { foo : 'baz' } ) ;
1184
+
1185
+ err ( function ( ) {
1186
+ expect ( { foo : 'bar' } ) . to . deep . equal ( { foo : 'baz' } , 'blah' ) ;
1187
+ } , "blah: expected { foo: 'bar' } to deeply equal { foo: 'baz' }" ) ;
1188
+
1189
+ err ( function ( ) {
1190
+ expect ( { foo : 'bar' } , 'blah' ) . to . deep . equal ( { foo : 'baz' } ) ;
1191
+ } , "blah: expected { foo: 'bar' } to deeply equal { foo: 'baz' }" ) ;
1192
+
1193
+ err ( function ( ) {
1194
+ expect ( { foo : 'bar' } ) . to . not . deep . equal ( { foo : 'bar' } , 'blah' ) ;
1195
+ } , "blah: expected { foo: 'bar' } to not deeply equal { foo: 'bar' }" ) ;
1196
+
1197
+ err ( function ( ) {
1198
+ expect ( { foo : 'bar' } , 'blah' ) . to . not . deep . equal ( { foo : 'bar' } ) ;
1199
+ } , "blah: expected { foo: 'bar' } to not deeply equal { foo: 'bar' }" ) ;
1184
1200
} ) ;
1185
1201
1186
1202
it ( 'deep.equal(/regexp/)' , function ( ) {
Original file line number Diff line number Diff line change @@ -1022,6 +1022,19 @@ describe('should', function() {
1022
1022
} , "blah: expected '4' to equal 4" ) ;
1023
1023
} ) ;
1024
1024
1025
+ it ( 'deep.equal(val)' , function ( ) {
1026
+ ( { foo : 'bar' } ) . should . deep . equal ( { foo : 'bar' } ) ;
1027
+ ( { foo : 'bar' } ) . should . not . deep . equal ( { foo : 'baz' } ) ;
1028
+
1029
+ err ( function ( ) {
1030
+ ( { foo : 'bar' } ) . should . deep . equal ( { foo : 'baz' } , 'blah' ) ;
1031
+ } , "blah: expected { foo: 'bar' } to deeply equal { foo: 'baz' }" ) ;
1032
+
1033
+ err ( function ( ) {
1034
+ ( { foo : 'bar' } ) . should . not . deep . equal ( { foo : 'bar' } , 'blah' ) ;
1035
+ } , "blah: expected { foo: 'bar' } to not deeply equal { foo: 'bar' }" ) ;
1036
+ } ) ;
1037
+
1025
1038
it ( 'empty' , function ( ) {
1026
1039
function FakeArgs ( ) { } ;
1027
1040
FakeArgs . prototype . length = 0 ;
You can’t perform that action at this time.
0 commit comments