@@ -730,15 +730,11 @@ describe('lib/optimizely', function() {
730
730
assert . strictEqual ( logMessage2 , sprintf ( LOG_MESSAGES . NOT_ACTIVATING_USER , 'OPTIMIZELY' , 'null' , 'testExperiment' ) ) ;
731
731
} ) ;
732
732
733
- it ( 'should throw an error for invalid experiment key' , function ( ) {
733
+ it ( 'should log an error for invalid experiment key' , function ( ) {
734
734
assert . isNull ( optlyInstance . activate ( 'invalidExperimentKey' , 'testUser' ) ) ;
735
735
736
736
sinon . assert . notCalled ( eventDispatcher . dispatchEvent ) ;
737
737
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
-
742
738
sinon . assert . calledTwice ( createdLogger . log ) ;
743
739
var logMessage1 = createdLogger . log . args [ 0 ] [ 1 ] ;
744
740
assert . strictEqual ( logMessage1 , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
@@ -1554,15 +1550,10 @@ describe('lib/optimizely', function() {
1554
1550
assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_INPUT_FORMAT , 'OPTIMIZELY' , 'user_id' ) ) ;
1555
1551
} ) ;
1556
1552
1557
- it ( 'should throw an error for invalid experiment key' , function ( ) {
1553
+ it ( 'should log an error for invalid experiment key' , function ( ) {
1558
1554
var getVariationWithError = optlyInstance . getVariation ( 'invalidExperimentKey' , 'testUser' ) ;
1559
-
1560
1555
assert . isNull ( getVariationWithError ) ;
1561
1556
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
-
1566
1557
sinon . assert . calledOnce ( createdLogger . log ) ;
1567
1558
var logMessage = createdLogger . log . args [ 0 ] [ 1 ] ;
1568
1559
assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
0 commit comments