Skip to content

chore (Regression Test)[CJS-3815]: Add tests for passing in a custom condition evaluator #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2020

Conversation

jamesopti
Copy link
Contributor

@jamesopti jamesopti commented Jan 24, 2020

Summary

#288 introduced an exploratory new feature, the ability to pass custom condition evaluators to the SDK constructor via the option UNSTABLE_conditionEvaluators.

The AudienceEvaluator (and its tests) were refactored as a part of that PR, but no tests were added to assert that the UNSTABLE_conditionEvaluators worked when passed.

This PR introduces tests to ensure that functionality continues to work.

Test plan

Unit tests added to assert that:

  • You cannot override the built in custom_attribute evaluator
  • A passed in custom condition evaluator will evaluate conditions of that type
  • That the audience condition, user attributes, and logger instance are all passed to the custom evaluator

Issues

  • CJS-3815


describe('APIs', function() {
describe('evaluate', function() {
context('with default condition evaluator', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the existing tests were changed in this PR. They were simply nested inside this context.

New tests at the bottom.

describe('Audience evaluation logging', function() {
var sandbox = sinon.sandbox.create();

context('with additional custom condition evaluator', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests here.

@jamesopti jamesopti changed the title add test for passing in a custom condition evaluator chore (Regression Test)[CJS-3815]: Add tests for passing in a custom condition evaluator Jan 24, 2020
@jamesopti jamesopti removed their assignment Jan 24, 2020
@coveralls
Copy link

coveralls commented Jan 24, 2020

Coverage Status

Coverage decreased (-0.004%) to 97.415% when pulling d06f24e on james/condition_evaluator_tests into 9039df2 on master.

@jamesopti jamesopti force-pushed the james/condition_evaluator_tests branch from 4c1b326 to d06f24e Compare January 29, 2020 22:41
@jamesopti jamesopti merged commit bc84698 into master Jan 29, 2020
@jamesopti jamesopti deleted the james/condition_evaluator_tests branch January 29, 2020 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants