Skip to content

Commit

Permalink
update logs as per python
Browse files Browse the repository at this point in the history
  • Loading branch information
fayyazarshad committed Jul 8, 2020
1 parent fcf75fb commit 940f462
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions packages/optimizely-sdk/lib/core/decision_service/index.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ describe('lib/core/decision_service', function() {
);
assert.isTrue(__audienceEvaluateSpy.alwaysReturned(false));

assert.strictEqual(3, mockLogger.log.callCount);
assert.strictEqual(2, mockLogger.log.callCount);
assert.strictEqual(
mockLogger.log.args[0][1],
'DECISION_SERVICE: Evaluating audiences for experiment "testExperimentWithAudiences": ["11154"].'
Expand All @@ -626,10 +626,6 @@ describe('lib/core/decision_service', function() {
mockLogger.log.args[1][1],
'DECISION_SERVICE: Audiences for experiment testExperimentWithAudiences collectively evaluated to FALSE.'
);
assert.strictEqual(
mockLogger.log.args[2][1],
'DECISION_SERVICE: User testUser does not meet conditions to be in experiment testExperimentWithAudiences.'
);
});

it('should return false when audience conditions are not met', function() {
Expand All @@ -645,7 +641,7 @@ describe('lib/core/decision_service', function() {
);
assert.isTrue(__audienceEvaluateSpy.alwaysReturned(false));

assert.strictEqual(3, mockLogger.log.callCount);
assert.strictEqual(2, mockLogger.log.callCount);
assert.strictEqual(
mockLogger.log.args[0][1],
'DECISION_SERVICE: Evaluating audiences for experiment "testExperimentWithAudiences": ["11154"].'
Expand All @@ -654,10 +650,6 @@ describe('lib/core/decision_service', function() {
mockLogger.log.args[1][1],
'DECISION_SERVICE: Audiences for experiment testExperimentWithAudiences collectively evaluated to FALSE.'
);
assert.strictEqual(
mockLogger.log.args[2][1],
'DECISION_SERVICE: User testUser does not meet conditions to be in experiment testExperimentWithAudiences.'
);
});
});

Expand Down Expand Up @@ -1380,7 +1372,7 @@ describe('lib/core/decision_service', function() {
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is not in rollout of feature test_feature_for_experiment.'
'DECISION_SERVICE: There is no rollout of feature test_feature_for_experiment.'
);
});
});
Expand Down Expand Up @@ -1466,7 +1458,7 @@ describe('lib/core/decision_service', function() {
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is not in rollout of feature feature_with_group.'
'BUCKETER: Assigned experiment bucket 593 to user user1.'
);
});

Expand Down Expand Up @@ -1635,11 +1627,6 @@ describe('lib/core/decision_service', function() {
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 bucketed into targeting rule 1.'
);
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is in rollout of feature test_feature.'
);
});
});

Expand Down Expand Up @@ -1759,11 +1746,6 @@ describe('lib/core/decision_service', function() {
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 bucketed into everyone targeting rule.'
);
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is in rollout of feature test_feature.'
);
});
});

Expand All @@ -1785,11 +1767,6 @@ describe('lib/core/decision_service', function() {
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 does not meet conditions for targeting rule 1.'
);
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is not in rollout of feature test_feature.'
);
});
});

Expand Down Expand Up @@ -2013,11 +1990,6 @@ describe('lib/core/decision_service', function() {
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 bucketed into everyone targeting rule.'
);
sinon.assert.calledWithExactly(
mockLogger.log,
LOG_LEVEL.DEBUG,
'DECISION_SERVICE: User user1 is in rollout of feature shared_feature.'
);
});
});

Expand Down

0 comments on commit 940f462

Please sign in to comment.