@@ -808,15 +808,11 @@ describe('lib/optimizely', function() {
808
808
assert . strictEqual ( logMessage2 , sprintf ( LOG_MESSAGES . NOT_ACTIVATING_USER , 'OPTIMIZELY' , 'null' , 'testExperiment' ) ) ;
809
809
} ) ;
810
810
811
- it ( 'should throw an error for invalid experiment key' , function ( ) {
811
+ it ( 'should log an error for invalid experiment key' , function ( ) {
812
812
assert . isNull ( optlyInstance . activate ( 'invalidExperimentKey' , 'testUser' ) ) ;
813
813
814
814
sinon . assert . notCalled ( eventDispatcher . dispatchEvent ) ;
815
815
816
- sinon . assert . calledOnce ( errorHandler . handleError ) ;
817
- var errorMessage = errorHandler . handleError . lastCall . args [ 0 ] . message ;
818
- assert . strictEqual ( errorMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
819
-
820
816
sinon . assert . calledTwice ( createdLogger . log ) ;
821
817
var logMessage1 = createdLogger . log . args [ 0 ] [ 1 ] ;
822
818
assert . strictEqual ( logMessage1 , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
@@ -1632,15 +1628,10 @@ describe('lib/optimizely', function() {
1632
1628
assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_INPUT_FORMAT , 'OPTIMIZELY' , 'user_id' ) ) ;
1633
1629
} ) ;
1634
1630
1635
- it ( 'should throw an error for invalid experiment key' , function ( ) {
1631
+ it ( 'should log an error for invalid experiment key' , function ( ) {
1636
1632
var getVariationWithError = optlyInstance . getVariation ( 'invalidExperimentKey' , 'testUser' ) ;
1637
-
1638
1633
assert . isNull ( getVariationWithError ) ;
1639
1634
1640
- sinon . assert . calledOnce ( errorHandler . handleError ) ;
1641
- var errorMessage = errorHandler . handleError . lastCall . args [ 0 ] . message ;
1642
- assert . strictEqual ( errorMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
1643
-
1644
1635
sinon . assert . calledOnce ( createdLogger . log ) ;
1645
1636
var logMessage = createdLogger . log . args [ 0 ] [ 1 ] ;
1646
1637
assert . strictEqual ( logMessage , sprintf ( ERROR_MESSAGES . INVALID_EXPERIMENT_KEY , 'OPTIMIZELY' , 'invalidExperimentKey' ) ) ;
0 commit comments