File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3311,8 +3311,9 @@ module.exports = function (chai, _) {
33113311 new Assertion ( obj , flagMsg , ssfi , true ) . is . a ( 'number' ) ;
33123312 if ( typeof expected !== 'number' || typeof delta !== 'number' ) {
33133313 flagMsg = flagMsg ? flagMsg + ': ' : '' ;
3314+ var deltaMessage = delta === undefined ? ", and a delta is required" : "" ;
33143315 throw new AssertionError (
3315- flagMsg + 'the arguments to closeTo or approximately must be numbers' ,
3316+ flagMsg + 'the arguments to closeTo or approximately must be numbers' + deltaMessage ,
33163317 undefined ,
33173318 ssfi
33183319 ) ;
Original file line number Diff line number Diff line change @@ -2950,8 +2950,9 @@ module.exports = function (chai, _) {
29502950 new Assertion ( obj , flagMsg , ssfi , true ) . is . a ( 'number' ) ;
29512951 if ( typeof expected !== 'number' || typeof delta !== 'number' ) {
29522952 flagMsg = flagMsg ? flagMsg + ': ' : '' ;
2953+ var deltaMessage = delta === undefined ? ", and a delta is required" : "" ;
29532954 throw new AssertionError (
2954- flagMsg + 'the arguments to closeTo or approximately must be numbers' ,
2955+ flagMsg + 'the arguments to closeTo or approximately must be numbers' + deltaMessage ,
29552956 undefined ,
29562957 ssfi
29572958 ) ;
Original file line number Diff line number Diff line change @@ -1848,6 +1848,10 @@ describe('assert', function () {
18481848 err ( function ( ) {
18491849 assert . closeTo ( 1.5 , 1.0 , true , 'blah' ) ;
18501850 } , "blah: the arguments to closeTo or approximately must be numbers" ) ;
1851+
1852+ err ( function ( ) {
1853+ assert . closeTo ( 1.5 , 1.0 , undefined , 'blah' ) ;
1854+ } , "blah: the arguments to closeTo or approximately must be numbers, and a delta is required" ) ;
18511855 } ) ;
18521856
18531857 it ( 'approximately' , function ( ) {
@@ -1874,6 +1878,10 @@ describe('assert', function () {
18741878 err ( function ( ) {
18751879 assert . approximately ( 1.5 , 1.0 , true , 'blah' ) ;
18761880 } , "blah: the arguments to closeTo or approximately must be numbers" ) ;
1881+
1882+ err ( function ( ) {
1883+ assert . approximately ( 1.5 , 1.0 , undefined , 'blah' ) ;
1884+ } , "blah: the arguments to closeTo or approximately must be numbers, and a delta is required" ) ;
18771885 } ) ;
18781886
18791887 it ( 'sameMembers' , function ( ) {
You can’t perform that action at this time.
0 commit comments