@@ -37,16 +37,13 @@ import { getMockProjectConfigManager } from '../tests/mock/mock_project_config_m
37
37
import { DECISION_NOTIFICATION_TYPES } from '../notification_center/type' ;
38
38
import {
39
39
AUDIENCE_EVALUATION_RESULT_COMBINED ,
40
- EVENT_KEY_NOT_FOUND ,
41
40
EXPERIMENT_NOT_RUNNING ,
42
41
FEATURE_HAS_NO_EXPERIMENTS ,
43
42
FEATURE_NOT_ENABLED_FOR_USER ,
44
- FORCED_BUCKETING_FAILED ,
45
43
INVALID_CLIENT_ENGINE ,
46
44
INVALID_DEFAULT_DECIDE_OPTIONS ,
47
45
INVALID_OBJECT ,
48
46
NOT_ACTIVATING_USER ,
49
- NOT_TRACKING_USER ,
50
47
RETURNING_STORED_VARIATION ,
51
48
USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE ,
52
49
USER_FORCED_IN_VARIATION ,
@@ -67,10 +64,13 @@ import {
67
64
import {
68
65
EXPERIMENT_KEY_NOT_IN_DATAFILE ,
69
66
INVALID_ATTRIBUTES ,
67
+ NOT_TRACKING_USER ,
68
+ EVENT_KEY_NOT_FOUND ,
70
69
INVALID_EXPERIMENT_KEY ,
71
70
INVALID_INPUT_FORMAT ,
72
71
NO_VARIATION_FOR_EXPERIMENT_KEY ,
73
72
USER_NOT_IN_FORCED_VARIATION ,
73
+ FORCED_BUCKETING_FAILED ,
74
74
} from '../error_messages' ;
75
75
import { FAILED_TO_STOP , ONREADY_TIMEOUT_EXPIRED , PROMISE_SHOULD_NOT_HAVE_RESOLVED } from '../exception_messages' ;
76
76
import { USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP } from '../core/bucketer' ;
@@ -1627,27 +1627,24 @@ describe('lib/optimizely', function() {
1627
1627
// assert.strictEqual(logMessage, sprintf(INVALID_INPUT_FORMAT, 'OPTIMIZELY', 'user_id'));
1628
1628
} ) ;
1629
1629
1630
- it . skip ( 'should log a warning for an event key that is not in the datafile and a warning for not tracking user' , function ( ) {
1631
- optlyInstance . track ( 'invalidEventKey' , 'testUser' ) ;
1630
+ it ( 'should log a warning for an event key that is not in the datafile and a warning for not tracking user' , function ( ) {
1631
+ const { optlyInstance, errorNotifier, createdLogger, eventDispatcher } = getOptlyInstance ( {
1632
+ datafileObj : testData . getTestDecideProjectConfig ( ) ,
1633
+ } ) ;
1632
1634
1633
- sinon . assert . calledTwice ( createdLogger . log ) ;
1635
+ sinon . stub ( createdLogger , 'warn' ) ;
1636
+
1637
+ optlyInstance . track ( 'invalidEventKey' , 'testUser' ) ;
1634
1638
1635
- var logCall1 = createdLogger . log . getCall ( 0 ) ;
1636
1639
sinon . assert . calledWithExactly (
1637
- // createLogger.warn,
1638
- logCall1 ,
1639
- LOG_LEVEL . WARNING ,
1640
+ createdLogger . warn ,
1640
1641
EVENT_KEY_NOT_FOUND ,
1641
- 'OPTIMIZELY' ,
1642
1642
'invalidEventKey'
1643
1643
) ;
1644
1644
1645
- var logCall2 = createdLogger . log . getCall ( 1 ) ;
1646
1645
sinon . assert . calledWithExactly (
1647
- logCall2 ,
1648
- LOG_LEVEL . WARNING ,
1646
+ createdLogger . warn ,
1649
1647
NOT_TRACKING_USER ,
1650
- 'OPTIMIZELY' ,
1651
1648
'testUser'
1652
1649
) ;
1653
1650
@@ -5153,7 +5150,7 @@ describe('lib/optimizely', function() {
5153
5150
) ;
5154
5151
} ) ;
5155
5152
5156
- it . skip ( 'should include reason when invalid forced variation found' , function ( ) {
5153
+ it ( 'should include reason when invalid forced variation found' , function ( ) {
5157
5154
var flagKey = 'feature_1' ;
5158
5155
var variationKey = 'invalid-key' ;
5159
5156
var newConfig = optlyInstance . projectConfigManager . getConfig ( ) ;
0 commit comments