@@ -730,15 +730,11 @@ describe('lib/optimizely', function() {
730730 assert . strictEqual ( logMessage2 , sprintf ( LOG_MESSAGES . NOT_ACTIVATING_USER , 'OPTIMIZELY' , 'null' , 'testExperiment' ) ) ;
731731 } ) ;
732732
733- it ( 'should throw an error for invalid experiment key' , function ( ) {
733+ it ( 'should log an error for invalid experiment key' , function ( ) {
734734 assert . isNull ( optlyInstance . activate ( 'invalidExperimentKey' , 'testUser' ) ) ;
735735
736736 sinon . assert . notCalled ( eventDispatcher . dispatchEvent ) ;
737737
738- sinon . assert . calledOnce ( errorHandler . handleError ) ;
739- var errorMessage = errorHandler . handleError . lastCall . args [ 0 ] . message ;
740- assert . strictEqual ( errorMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
741-
742738 sinon . assert . calledTwice ( createdLogger . log ) ;
743739 var logMessage1 = createdLogger . log . args [ 0 ] [ 1 ] ;
744740 assert . strictEqual ( logMessage1 , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
@@ -1554,15 +1550,10 @@ describe('lib/optimizely', function() {
15541550 assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_INPUT_FORMAT , 'OPTIMIZELY' , 'user_id' ) ) ;
15551551 } ) ;
15561552
1557- it ( 'should throw an error for invalid experiment key' , function ( ) {
1553+ it ( 'should log an error for invalid experiment key' , function ( ) {
15581554 var getVariationWithError = optlyInstance . getVariation ( 'invalidExperimentKey' , 'testUser' ) ;
1559-
15601555 assert . isNull ( getVariationWithError ) ;
15611556
1562- sinon . assert . calledOnce ( errorHandler . handleError ) ;
1563- var errorMessage = errorHandler . handleError . lastCall . args [ 0 ] . message ;
1564- assert . strictEqual ( errorMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
1565-
15661557 sinon . assert . calledOnce ( createdLogger . log ) ;
15671558 var logMessage = createdLogger . log . args [ 0 ] [ 1 ] ;
15681559 assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
0 commit comments