The rule was not matching, after debugging it was found that the expected rule operator field was named op not operator. This was found by debugging until getting to the matchFn function in evaluator.js.
There was also another issue where updating when using an ifMatch resulted in a JSON ref error. Replaced JSON based copy with manual copy.
Requirements
[x] I have added test coverage for new or changed functionality
Describe the solution you've provided
This PR fixes the JSON circular ref by using a manual copy method in TestDataRuleBuilder rather than using JSON.stringify.
It fixes the rules not matching by using op rather than operator when using TestDataRuleBuilder.andMatch
The rule was not matching, after debugging it was found that the expected rule operator field was named
op
notoperator
. This was found by debugging until getting to the matchFn function inevaluator.js
.There was also another issue where updating when using an ifMatch resulted in a JSON ref error. Replaced JSON based copy with manual copy. Requirements
Related issues https://github.com/launchdarkly/node-server-sdk/issues/258
Describe the solution you've provided This PR fixes the JSON circular ref by using a manual copy method in TestDataRuleBuilder rather than using JSON.stringify. It fixes the rules not matching by using
op
rather thanoperator
when usingTestDataRuleBuilder.andMatch