@@ -49,7 +49,7 @@ import * as util from './utils/index.js';
49
49
* @returns {unknown }
50
50
* @private
51
51
*/
52
- export function Assertion ( obj , msg , ssfi , lockSsfi ) {
52
+ export function Assertion ( obj , msg , ssfi , lockSsfi ) {
53
53
util . flag ( this , 'ssfi' , ssfi || Assertion ) ;
54
54
util . flag ( this , 'lockSsfi' , lockSsfi ) ;
55
55
util . flag ( this , 'object' , obj ) ;
@@ -60,23 +60,31 @@ export function Assertion (obj, msg, ssfi, lockSsfi) {
60
60
}
61
61
62
62
Object . defineProperty ( Assertion , 'includeStack' , {
63
- get : function ( ) {
64
- console . warn ( 'Assertion.includeStack is deprecated, use chai.config.includeStack instead.' ) ;
63
+ get : function ( ) {
64
+ console . warn (
65
+ 'Assertion.includeStack is deprecated, use chai.config.includeStack instead.'
66
+ ) ;
65
67
return config . includeStack ;
66
68
} ,
67
- set : function ( value ) {
68
- console . warn ( 'Assertion.includeStack is deprecated, use chai.config.includeStack instead.' ) ;
69
+ set : function ( value ) {
70
+ console . warn (
71
+ 'Assertion.includeStack is deprecated, use chai.config.includeStack instead.'
72
+ ) ;
69
73
config . includeStack = value ;
70
74
}
71
75
} ) ;
72
76
73
77
Object . defineProperty ( Assertion , 'showDiff' , {
74
- get : function ( ) {
75
- console . warn ( 'Assertion.showDiff is deprecated, use chai.config.showDiff instead.' ) ;
78
+ get : function ( ) {
79
+ console . warn (
80
+ 'Assertion.showDiff is deprecated, use chai.config.showDiff instead.'
81
+ ) ;
76
82
return config . showDiff ;
77
83
} ,
78
- set : function ( value ) {
79
- console . warn ( 'Assertion.showDiff is deprecated, use chai.config.showDiff instead.' ) ;
84
+ set : function ( value ) {
85
+ console . warn (
86
+ 'Assertion.showDiff is deprecated, use chai.config.showDiff instead.'
87
+ ) ;
80
88
config . showDiff = value ;
81
89
}
82
90
} ) ;
@@ -120,7 +128,14 @@ Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
120
128
* @private
121
129
*/
122
130
123
- Assertion . prototype . assert = function ( expr , msg , negateMsg , expected , _actual , showDiff ) {
131
+ Assertion . prototype . assert = function (
132
+ expr ,
133
+ msg ,
134
+ negateMsg ,
135
+ expected ,
136
+ _actual ,
137
+ showDiff
138
+ ) {
124
139
var ok = util . test ( this , arguments ) ;
125
140
if ( false !== showDiff ) showDiff = true ;
126
141
if ( undefined === expected && undefined === _actual ) showDiff = false ;
@@ -130,9 +145,9 @@ Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual,
130
145
msg = util . getMessage ( this , arguments ) ;
131
146
var actual = util . getActual ( this , arguments ) ;
132
147
var assertionErrorObjectProperties = {
133
- actual : actual
134
- , expected : expected
135
- , showDiff : showDiff
148
+ actual : actual ,
149
+ expected : expected ,
150
+ showDiff : showDiff
136
151
} ;
137
152
138
153
var operator = util . getOperator ( this , arguments ) ;
@@ -143,7 +158,8 @@ Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual,
143
158
throw new AssertionError (
144
159
msg ,
145
160
assertionErrorObjectProperties ,
146
- ( config . includeStack ) ? this . assert : util . flag ( this , 'ssfi' ) ) ;
161
+ config . includeStack ? this . assert : util . flag ( this , 'ssfi' )
162
+ ) ;
147
163
}
148
164
} ;
149
165
@@ -154,11 +170,11 @@ Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual,
154
170
*
155
171
* @private
156
172
*/
157
- Object . defineProperty ( Assertion . prototype , '_obj' ,
158
- { get : function ( ) {
159
- return util . flag ( this , 'object' ) ;
160
- }
161
- , set : function ( val ) {
162
- util . flag ( this , 'object' , val ) ;
163
- }
173
+ Object . defineProperty ( Assertion . prototype , '_obj' , {
174
+ get : function ( ) {
175
+ return util . flag ( this , 'object' ) ;
176
+ } ,
177
+ set : function ( val ) {
178
+ util . flag ( this , 'object' , val ) ;
179
+ }
164
180
} ) ;
0 commit comments