@@ -245,7 +245,7 @@ describe('bodyParser.json()', function () {
245245 . post ( '/' )
246246 . set ( 'Content-Type' , 'application/json' )
247247 . send ( 'true' )
248- . expect ( 400 , '[entity.parse.failed] ' + parseError ( '#rue' ) . replace ( '#' , 't' ) , done )
248+ . expect ( 400 , '[entity.parse.failed] ' + parseError ( '#rue' ) . replace ( / # / g , 't' ) , done )
249249 } )
250250 } )
251251
@@ -273,15 +273,15 @@ describe('bodyParser.json()', function () {
273273 . post ( '/' )
274274 . set ( 'Content-Type' , 'application/json' )
275275 . send ( 'true' )
276- . expect ( 400 , '[entity.parse.failed] ' + parseError ( '#rue' ) . replace ( '#' , 't' ) , done )
276+ . expect ( 400 , '[entity.parse.failed] ' + parseError ( '#rue' ) . replace ( / # / g , 't' ) , done )
277277 } )
278278
279279 it ( 'should not parse primitives with leading whitespaces' , function ( done ) {
280280 request ( this . server )
281281 . post ( '/' )
282282 . set ( 'Content-Type' , 'application/json' )
283283 . send ( ' true' )
284- . expect ( 400 , '[entity.parse.failed] ' + parseError ( ' #rue' ) . replace ( '#' , 't' ) , done )
284+ . expect ( 400 , '[entity.parse.failed] ' + parseError ( ' #rue' ) . replace ( / # / g , 't' ) , done )
285285 } )
286286
287287 it ( 'should allow leading whitespaces in JSON' , function ( done ) {
@@ -299,7 +299,7 @@ describe('bodyParser.json()', function () {
299299 . set ( 'X-Error-Property' , 'stack' )
300300 . send ( 'true' )
301301 . expect ( 400 )
302- . expect ( shouldContainInBody ( parseError ( '#rue' ) . replace ( '#' , 't' ) ) )
302+ . expect ( shouldContainInBody ( parseError ( '#rue' ) . replace ( / # / g , 't' ) ) )
303303 . end ( done )
304304 } )
305305 } )
0 commit comments