@@ -252,7 +252,7 @@ describe('Interpolator', () => {
252
252
} ) ;
253
253
} ) ;
254
254
255
- describe ( "interpolate() - with missing interpolation value" , ( ) => {
255
+ describe ( "interpolate() - with undefined interpolation value" , ( ) => {
256
256
var ip ;
257
257
var tests = [
258
258
{ args : [ '{{test}}' ] , expected : '' } ,
@@ -275,7 +275,7 @@ describe('Interpolator', () => {
275
275
} ) ;
276
276
} ) ;
277
277
278
- describe ( "interpolate() - with missing interpolation value - filled by missingInterpolationHandler" , ( ) => {
278
+ describe ( "interpolate() - with undefined interpolation value - filled by missingInterpolationHandler" , ( ) => {
279
279
var ip ;
280
280
var tests = [
281
281
{ args : [ '{{test}}' ] , expected : 'test' } ,
@@ -298,4 +298,25 @@ describe('Interpolator', () => {
298
298
} ) ;
299
299
} ) ;
300
300
} ) ;
301
+
302
+ describe ( "interpolate() - with null interpolation value - not filled by missingInterpolationHandler" , ( ) => {
303
+ var ip ;
304
+ var tests = [
305
+ { args : [ '{{test}}' , { test : null } ] , expected : '' } ,
306
+ ] ;
307
+
308
+ before ( ( ) => {
309
+ ip = new Interpolator ( {
310
+ missingInterpolationHandler : ( str , match ) => {
311
+ return 'test'
312
+ }
313
+ } ) ;
314
+ } ) ;
315
+
316
+ tests . forEach ( ( test ) => {
317
+ it ( 'correctly interpolates for ' + JSON . stringify ( test . args ) + ' args' , ( ) => {
318
+ expect ( ip . interpolate . apply ( ip , test . args ) ) . to . eql ( test . expected ) ;
319
+ } ) ;
320
+ } ) ;
321
+ } ) ;
301
322
} ) ;
0 commit comments