diff --git a/CHANGELOG.md b/CHANGELOG.md index f058119..ba00cbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.2] - 2024-06-05 + +### Fixed + +- Fix: use experiment-key from rule instead of whitelisted object +- Use [vwo-fme-sdk-e2e-test-settings-n-cases](https://github.com/wingify/vwo-fme-sdk-e2e-test-settings-n-cases) for importing segmentation tests instead of using hardcoded + +## [1.2.1] - 2024-05-30 + +### Fixed + +- Handle how device was being used by User-Agent parser. +- Refactor VWO Gateway service code to handle non-US accounts +- Fix passing required headers in the network-calls for tracking user details to VWO servers +- Fix some log messages where variables were not getting interpolated correctly + +### Changed + +- Instead of hardcoding the test-cases and expectations for `getFlag` API, we create a separate repo where tests and expectations were written in a JSON format. This is done to make sure we have common and same tests passing across our FME SDKs. Node SDK is using it as dependency - [vwo-fme-sdk-e2e-test-settings-n-cases](https://github.com/wingify/vwo-fme-sdk-e2e-test-settings-n-cases) +- SDK is now fully supported from Node 12+ versions. We ensured this by running exhaustive unit/E2E tests via GitHub actions for all the Node 12+ versions +- Add a new github-action to generate and publish code documentation generated via `typedoc` + ## [1.2.0] - 2024-05-22 ### Changed diff --git a/package.json b/package.json index 6340358..1968dcd 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "typedoc": "^0.25.13", "typescript": "^5.4.5", "typescript-eslint": "^7.8.0", - "vwo-fme-sdk-e2e-test-settings-n-cases": "^1.0.1" + "vwo-fme-sdk-e2e-test-settings-n-cases": "^1.1.1" }, "lint-staged": { "**/*.{ts,json,md}": [ diff --git a/test/data/SegmentEvaluatorData.ts b/test/data/SegmentEvaluatorData.ts deleted file mode 100644 index 5f3ee1b..0000000 --- a/test/data/SegmentEvaluatorData.ts +++ /dev/null @@ -1,9828 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export class SegmentEvaluatorData { - data = { - and_operator: { - single_and_operator_matching: { - dsl: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - single_and_operator_case_mismatch: { - dsl: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Eq_Value', - }, - }, - multiple_and_operator2: { - dsl: { - and: [ - { - and: [ - { - and: [ - { - and: [ - { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_and_operator_with_all_incorrect_correct_values: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'wrong', - reg: 'wrong', - }, - }, - multiple_and_operator_with_single_correct_value2: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'wrong', - reg: 'myregexxxxxx', - }, - }, - multiple_and_operator_with_all_correct_values: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - reg: 'myregexxxxxx', - }, - }, - single_and_operator_mismatch: { - dsl: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'n_eq_value', - }, - }, - multiple_and_operator_with_single_correct_value: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - reg: 'wrong', - }, - }, - }, - case_insensitive_equality_operand: { - exact_match_with_special_characters: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - float_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.456)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - numeric_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 12, - }, - }, - float_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.456)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123.4567, - }, - }, - incorrect_key: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - neq: 'something', - }, - }, - incorrect_key_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(zzsomethingzz)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'i', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(e)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'Something', - }, - }, - exact_match_with_spaces: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(nice to see you. will YOU be my Friend?)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'nice to see you. will YOU be my Friend?', - }, - }, - stringified_float: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: '123.456000000', - }, - }, - char_data_type_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(E)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'e', - }, - }, - char_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(E)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(true)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - boolean_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(true)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.0, - }, - }, - mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'notsomething', - }, - }, - numeric_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123, - }, - }, - exact_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - part_of_text: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(zzsomethingzz)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - exact_match_with_upper_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - null_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: null, - }, - }, - boolean_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(false)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - no_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: '', - }, - }, - missingkey_value: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: {}, - }, - stringified_float3: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.4560000)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - stringified_float2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.0)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123, - }, - }, - case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'SOMETHINg', - }, - }, - float_data_type_extra_decimal_zeros: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - boolean_data_type3: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(True)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - boolean_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(false)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lower(123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - }, - complex_and_ors: { - complex_dsl_1: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 1, - contain: 1, - eq: 1, - start_with: 'my_start_with_valzzzzzzzzzzzzzzzz', - neq: 1, - }, - }, - complex_dsl_2: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 1, - contain: 1, - eq: 1, - start_with: 1, - neq: 'not_eq_value', - }, - }, - complex_dsl_3: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 1, - contain: 'zzzzzzmy_contain_valzzzzz', - eq: 1, - start_with: 'm1y_1sta1rt_with_val', - neq: false, - }, - }, - complex_dsl_4: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 1, - contain: 'my_ contain _val', - eq: 'eq_value', - start_with: 'm1y_1sta1rt_with_val', - neq: null, - }, - }, - complex_dsl_5: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 'myregexxxxxx', - contain: 'my_ contain _val', - eq: 'eq__value', - start_with: 'm1y_1sta1rt_with_val', - neq: 123, - }, - }, - complex_dsl_6: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 'myregexxxxxx', - contain: 'my$contain$val', - eq: 'eq_value', - start_with: 'm1y_1sta1rt_with_val', - neq: 'not_matching', - }, - }, - }, - complex_dsl_1: { - matching_contains_with_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 1, - contain: 'zzzzzzmy_contain_valzzzzz', - eq: 1, - start_with: 'm1y_1sta1rt_with_val', - neq: false, - }, - }, - matching_both_start_with_and_not_equal_to_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 1, - contain: 1, - eq: 1, - start_with: 'my_start_with_valzzzzzzzzzzzzzzzz', - neq: 'not_eq_value', - }, - }, - matching_not_equal_to_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 1, - contain: 1, - eq: 1, - start_with: 1, - neq: 'not_eq_value', - }, - }, - matching_start_with_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 1, - contain: 1, - eq: 1, - start_with: 'my_start_with_valzzzzzzzzzzzzzzzz', - neq: 1, - }, - }, - matching_regex_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 'myregexxxxxx', - contain: 'my_ contain _val', - eq: 'eq__value', - start_with: 'm1y_1sta1rt_with_val', - neq: 123, - }, - }, - matching_both_equal_to_and_regex_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - reg: 'myregexxxxxx', - contain: 'my$contain$val', - eq: 'eq_value', - start_with: 'm1y_1sta1rt_with_val', - neq: 'not_matching', - }, - }, - matching_equal_to_value: { - dsl: { - or: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - start_with: 'wildcard(my_start_with_val*)', - }, - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contain: 'wildcard(*my_contain_val*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - reg: 1, - contain: 'my_ contain _val', - eq: 'eq_value', - start_with: 'm1y_1sta1rt_with_val', - neq: null, - }, - }, - }, - complex_dsl_2: { - false4: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_starts_with: 'v owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwovovwo', - vwo_contains: 'vwo', - }, - }, - false1: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_starts_with: 'owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwovwo', - notvwo: 'vwo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwovw', - vwo_contains: 'vwo', - }, - }, - false3: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_starts_with: 'vwo owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwo', - regex_vwo: 'this isvwo', - vwovwovwo: 'vwovwovw', - vwo_contains: 'vwo', - }, - }, - false2: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_starts_with: 'vwo owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwo', - vwo_contains: 'vwo', - }, - }, - true4: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_starts_with: 'vwo owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwovwovwo', - vwo_contains: 'vw', - }, - }, - true1: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_starts_with: 'owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwovwovwo', - vwo_contains: 'vwo', - }, - }, - true3: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_starts_with: 'owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwovwo', - regex_vwo: 'this isvwo', - vwovwovwo: 'vwovwovwo', - vwo_contains: 'vwo', - }, - }, - true2: { - dsl: { - or: [ - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_starts_with: 'owv vwo', - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - notvwo: 'vwo', - regex_vwo: 'this is vwo', - vwovwovwo: 'vwo', - vwo_contains: 'vwo', - }, - }, - }, - complex_dsl_3: { - false5: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 12231023, - regex_for_all_letters: 'dsfASF6', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: '0001000', - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - false4: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'is_not_equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - false6: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 12231023, - regex_for_all_letters: 'dsfASF6', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'startss_with_variable', - }, - }, - false1: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'wingify', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - false3: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 'not a number', - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - false2: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'thisis regex', - starts_with: '_variable', - }, - }, - true4: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - true1: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 1223123, - regex_for_all_letters: 'dsfASF', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 1234, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - true3: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 12231023, - regex_for_all_letters: 'dsfASF6', - regex_for_small_letters: 'sadfAksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - true2: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - contains_vwo: 'wildcard(*vwo*)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - regex_for_all_letters: 'regex(^[A-z]+$)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_capital_letters: 'regex(^[A-Z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_small_letters: 'regex(^[a-z]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_no_zeros: 'regex(^[1-9]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_for_zeros: 'regex(^[0]+$)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_real_number: 'regex(^\\d+(\\.\\d+)?)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - or: [ - { - custom_variable: { - this_is_regex: 'regex(this\\s+is\\s+text)', - }, - }, - ], - }, - { - and: [ - { - and: [ - { - or: [ - { - custom_variable: { - starts_with: 'wildcard(starts_with_variable*)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - contains: 'wildcard(*contains_variable*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - not: { - or: [ - { - custom_variable: { - is_not_equal_to: 'is_not_equal_to_variable', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - is_equal_to: 'equal_to_variable', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - contains_vwo: 'legends say that vwo is the best', - regex_for_no_zeros: 12231023, - regex_for_all_letters: 'dsfASF6', - regex_for_small_letters: 'sadfksjdf', - regex_real_number: 12321.2242, - regex_for_zeros: 0, - is_equal_to: 'equal_to_variable', - contains: 'contains_variable', - regex_for_capital_letters: 'SADFLSDLF', - is_not_equal_to: 'is_not_equal_to_variable', - this_is_regex: 'this is regex', - starts_with: 'starts_with_variable', - }, - }, - }, - complex_dsl_4: { - false4: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'vwo', - regex_vwo: 'this is vwo', - thanos: 'snap', - lol: 'lollolololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'lba', - vwo_contains: 'vwo vwo vwo vwo vwo', - }, - }, - false1: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'owv vwo', - regex_vwo: 'this is vwo', - thanos: 'half universe', - lol: 'lolololololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'bla bla bla', - vwo_contains: 'vwo vwo', - }, - }, - false3: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'vwo', - regex_vwo: 'this is vwo', - thanos: 'snap', - lol: 'lollolololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'bla bla bla', - vwo_contains: 'vwo vwo vwo vwo', - }, - }, - true1: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'owv vwo', - regex_vwo: 'this is vwo', - thanos: 'half universe', - lol: 'lollolololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'bla bla bla', - vwo_contains: 'vwo vwo vwo vwo vwo', - }, - }, - true3: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'owv vwo', - regex_vwo: 'this is vwo', - thanos: 'half universe', - lol: 'lolololololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'bla bla bla', - vwo_contains: 'vwo vwo vwo vwo vwo', - }, - }, - true2: { - dsl: { - and: [ - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - thanos: 'snap', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - batman: 'wildcard(*i am batman*)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - joker: 'regex((joker)+)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - or: [ - { - or: [ - { - custom_variable: { - lol: 'lolololololol', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - blablabla: 'wildcard(*bla*)', - }, - }, - ], - }, - ], - }, - { - and: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - notvwo: 'notvwo', - }, - }, - ], - }, - }, - { - or: [ - { - and: [ - { - or: [ - { - custom_variable: { - vwovwovwo: 'regex(vwovwovwo)', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - regex_vwo: 'regex(this\\s+is\\s+vwo)', - }, - }, - ], - }, - ], - }, - { - or: [ - { - and: [ - { - not: { - or: [ - { - custom_variable: { - vwo_not_equal_to: 'owv', - }, - }, - ], - }, - }, - { - or: [ - { - custom_variable: { - vwo_equal_to: 'vwo', - }, - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_starts_with: 'wildcard(owv vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - or: [ - { - custom_variable: { - vwo_contains: 'wildcard(*vwo vwo vwo vwo vwo*)', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - vwo_not_equal_to: 'vwo', - vwo_equal_to: 'vwo', - vwovwovwo: 'vwovwovwo', - vwo_starts_with: 'owv vwo', - regex_vwo: 'this is vwo', - thanos: 'snap', - lol: 'lolololololol', - notvwo: 'vwo', - joker: 'joker joker joker', - batman: 'hello i am batman world', - blablabla: 'bla bla bla', - vwo_contains: 'vwo vwo vwo vwo vwo', - }, - }, - }, - contains_operand: { - incorrect_key: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - neq: 'something', - }, - }, - incorrect_key_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*zzsomethingzz*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'i', - }, - }, - case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Something', - }, - }, - char_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*E*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - prefix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'somethingdfgdwerewew', - }, - }, - boolean_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*true*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - part_of_text: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*zzsomethingzz*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - null_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: null, - }, - }, - upper_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'A-N-Y-T-H-I-N-G---HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH----A-N-Y-T-H-I-N-G', - }, - }, - no_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: '', - }, - }, - suffix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'asdn3kn42knsdsomething', - }, - }, - boolean_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*false*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 765123.4567364, - }, - }, - numeric_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 12, - }, - }, - contains_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'asdn3kn42knsdsomethingjsbdj', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*e*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'E', - }, - }, - special_characters: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'A-N-Y-T-H-I-N-G---f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!----A-N-Y-T-H-I-N-G', - }, - }, - stringified_float: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: '87654123.4567902', - }, - }, - char_data_type_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*E*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'e', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*true*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 765123.7364, - }, - }, - spaces: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*nice to see you. will you be my friend?*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'Hello there!! nice to see you. will you be my friend? Yes, Great!!', - }, - }, - mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'qwertyu', - }, - }, - exact_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - numeric_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 365412363, - }, - }, - boolean_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*false*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - missingkey_value: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: {}, - }, - case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'SOMETHING', - }, - }, - contains_operand_falsy_with_special_character: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*some*thing*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'hellosomethingworld', - }, - }, - }, - ends_with_operand: { - numeric_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 12, - }, - }, - float_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - float_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123.4567, - }, - }, - incorrect_key: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - neq: 'something', - }, - }, - contains_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'asdn3kn42knsdsomethingmm', - }, - }, - incorrect_key_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*zzsomethingzz)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'i', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*e)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'E', - }, - }, - case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Something', - }, - }, - special_characters: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'A-N-Y-T-H-I-N-G---f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - char_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*E)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - stringified_float: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: '87654123.456000000', - }, - }, - char_data_type_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*E)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'e', - }, - }, - prefix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'somethingdfgdwerewew', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*true)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - boolean_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*true)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 765123.0, - }, - }, - spaces: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*nice to see you. will you be my friend?)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'Hello there!! nice to see you. will you be my friend?', - }, - }, - mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'qwertyu', - }, - }, - numeric_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 3654123, - }, - }, - exact_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - part_of_text: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*zzsomethingzz)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - boolean_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*false)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - null_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: null, - }, - }, - upper_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'A-N-Y-T-H-I-N-G---HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - no_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: '', - }, - }, - missingkey_value: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: {}, - }, - stringified_float3: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.4560000)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 98765123.456, - }, - }, - stringified_float2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.0)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 7657123, - }, - }, - case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'SOMETHING', - }, - }, - float_data_type_extra_decimal_zeros: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 765123.456, - }, - }, - suffix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'asdn3kn42knsdsomething', - }, - }, - boolean_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*false)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(*123.456)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 765123.456, - }, - }, - }, - equality_operand: { - float_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - float_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123.4567, - }, - }, - incorrect_key: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - neq: 'something', - }, - }, - incorrect_key_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - or: [ - { - custom_variable: { - eq: 'zzsomethingzz', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'i', - }, - }, - case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Something', - }, - }, - numeric_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 12, - }, - }, - char_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'E', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - boolean_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'true', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - part_of_text: { - dsl: { - or: [ - { - custom_variable: { - eq: 'zzsomethingzz', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - exact_match_with_upper_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - null_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: null, - }, - }, - no_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: '', - }, - }, - boolean_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'false', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - exact_match_with_special_characters: { - dsl: { - or: [ - { - custom_variable: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'e', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'E', - }, - }, - exact_match_with_spaces: { - dsl: { - or: [ - { - custom_variable: { - eq: 'nice to see you. will you be my friend?', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'nice to see you. will you be my friend?', - }, - }, - stringified_float: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: '123.456000000', - }, - }, - char_data_type_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'E', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'e', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'true', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.0, - }, - }, - mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'notsomething', - }, - }, - exact_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - numeric_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123, - }, - }, - boolean_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'false', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - missingkey_value: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: {}, - }, - stringified_float3: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.4560000', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - stringified_float2: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.0', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123, - }, - }, - case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'SOMETHING', - }, - }, - float_data_type_extra_decimal_zeros: { - dsl: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456, - }, - }, - }, - new_cases_for_decimal_mismatch: { - endswith_decimal: { - dsl: { - or: [ - { - custom_variable: { - val: 'wildcard(*123)', - }, - }, - ], - }, - expectation: true, - customVariables: { - val: 765123.0, - }, - }, - contains_decimal2: { - dsl: { - or: [ - { - custom_variable: { - val: 'wildcard(*123.0*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - val: 876123, - }, - }, - contains_decimal: { - dsl: { - or: [ - { - custom_variable: { - val: 'wildcard(*123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - val: 654123.2323, - }, - }, - }, - not_operator: { - exact_match_with_special_characters: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!', - }, - }, - float_data_type_mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 123, - }, - }, - numeric_data_type_mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 12, - }, - }, - float_data_type_mismatch2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 123.4567, - }, - }, - incorrect_key: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'something', - }, - }, - incorrect_key_case: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'zzsomethingzz', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'i', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'e', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - case_mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'Something', - }, - }, - exact_match_with_spaces: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'nice to see you. will you be my friend?', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 'nice to see you. will you be my friend?', - }, - }, - multiple_not_operator5: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - neq: 'eq_value', - }, - }, - multiple_not_operator4: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'eq_value', - }, - }, - stringified_float: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: '123.456000000', - }, - }, - multiple_not_operator6: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - neq: 'eq_value', - }, - }, - boolean_data_type_mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'false', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - multiple_not_operator3: { - dsl: { - and: [ - { - not: { - and: [ - { - not: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_not_operator2: { - dsl: { - and: [ - { - and: [ - { - not: { - and: [ - { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - char_data_type: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'E', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 'E', - }, - }, - multiple_not_operator7: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'neq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'eq_value', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'true', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - boolean_data_type: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'true', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123.0, - }, - }, - mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'notsomething', - }, - }, - numeric_data_type: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - exact_match: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - part_of_text: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'zzsomethingzz', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - multiple_not_operator: { - dsl: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - exact_match_with_upper_case: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH', - }, - }, - nested_not_operator: { - dsl: { - or: [ - { - or: [ - { - not: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - null_value_provided: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: null, - }, - }, - no_value_provided: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: '', - }, - }, - missingkey_value: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: {}, - }, - stringified_float3: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.4560000', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123.456, - }, - }, - stringified_float2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.0', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - case_mismatch2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'something', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'SOMETHING', - }, - }, - float_data_type_extra_decimal_zeros: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123.456, - }, - }, - char_data_type_case_mismatch: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'E', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - eq: 'e', - }, - }, - boolean_data_type2: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: 'false', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - not: { - or: [ - { - custom_variable: { - eq: '123.456', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - eq: 123.456, - }, - }, - }, - or_operator: { - multiple_or_operator_with_single_correct_value: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - reg: 'wrong', - }, - }, - single_or_operator_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'n_eq_value', - }, - }, - multiple_or_operator: { - dsl: { - or: [ - { - or: [ - { - or: [ - { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_or_operator_with_all_incorrect_correct_values: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'wrong', - reg: 'wrong', - }, - }, - single_or_operator_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Eq_Value', - }, - }, - multiple_or_operator_with_all_correct_values: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - reg: 'myregeXxxxxx', - }, - }, - single_or_operator_matching: { - dsl: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_or_operator_with_single_correct_value2: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'wrong', - reg: 'myregexxxxxx', - }, - }, - }, - regex: { - regex_operand_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(<(W[^>]*)(.*?)>)', - }, - }, - ], - }, - expectation: false, - customVariables: { - reg: '', - }, - }, - regex_operand2: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(<(W[^>]*)(.*?)>)', - }, - }, - ], - }, - expectation: true, - customVariables: { - reg: '', - }, - }, - invalid_reqex: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - reg: '*', - }, - }, - invalid_reqex2: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - reg: 'asdf', - }, - }, - regex_operand_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - expectation: false, - customVariables: { - reg: 'myregeXxxxxx', - }, - }, - regex_operand: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - expectation: true, - customVariables: { - reg: 'myregexxxxxx', - }, - }, - }, - simple_and_ors: { - single_not_true: { - dsl: { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'eq_valaue', - }, - }, - chain_of_and_nullify_not_true: { - dsl: { - and: [ - { - not: { - and: [ - { - not: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - dsl_lower_true: { - dsl: { - or: [ - { - custom_variable: { - a: 'lower(something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'SoMeThIng', - }, - }, - dsl_regex_true: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - expectation: true, - customVariables: { - reg: 'myregexxxxxx', - }, - }, - chain_of_not_5_false: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - neq: 'eq_value', - }, - }, - dsl_lower_false: { - dsl: { - or: [ - { - custom_variable: { - a: 'lower(something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'SoMeThIngS', - }, - }, - dsl_regex_false: { - dsl: { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - expectation: false, - customVariables: { - reg: 'myregeXxxxxx', - }, - }, - chain_of_not_4_true: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'eq_value', - }, - }, - dsl_eq_false: { - dsl: { - not: { - or: [ - { - custom_variable: { - a: 'something', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - a: 'something', - }, - }, - single_not_false: { - dsl: { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - neq: 'not_eq_value', - }, - }, - chain_of_or_nullify_not_true: { - dsl: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - dsl_wildcard_true_front_back_middle_star: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*some*thing*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'hellosome*thingworld', - }, - }, - chain_of_or_middle_not_false: { - dsl: { - or: [ - { - or: [ - { - not: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - chain_of_not_4_false: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'not_eq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - neq: 'eq_valaue', - }, - }, - dsl_wildcard_true_back: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'somethingworld', - }, - }, - single_or_true: { - dsl: { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_or_true: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - reg: 'myregeXxxxxx', - }, - }, - dsl_wildcard_true_front: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*something)', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'hellosomething', - }, - }, - dsl_wildcard_false: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*something)', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'somethin', - }, - }, - chain_of_and_true: { - dsl: { - and: [ - { - and: [ - { - and: [ - { - and: [ - { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - chain_of_and_middle_not_false: { - dsl: { - and: [ - { - and: [ - { - not: { - and: [ - { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - single_or_false: { - dsl: { - or: [ - { - custom_variable: { - eq: 'n_eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - dsl_eq_true: { - dsl: { - or: [ - { - custom_variable: { - a: 'something', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'something', - }, - }, - multiple_and_true: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - reg: 'myregexxxxxx', - }, - }, - chain_of_not_5_true: { - dsl: { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - not: { - or: [ - { - custom_variable: { - neq: 'neq_value', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - expectation: true, - customVariables: { - neq: 'eq_value', - }, - }, - multiple_or_false: { - dsl: { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_values', - reg: 'myregeXxxxxx', - }, - }, - single_and_true: { - dsl: { - and: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - multiple_and_false: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - { - or: [ - { - custom_variable: { - reg: 'regex(myregex+)', - }, - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - reg: 'myregeXxxxxx', - }, - }, - dsl_wildcard_true_front_back: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - a: 'hellosomethingworld', - }, - }, - chain_of_or_true: { - dsl: { - or: [ - { - or: [ - { - or: [ - { - or: [ - { - or: [ - { - custom_variable: { - eq: 'eq_value', - }, - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - eq: 'eq_value', - }, - }, - dsl_wildcard_false_front_back_middle_star: { - dsl: { - or: [ - { - custom_variable: { - a: 'wildcard(*some*thing*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - a: 'hellosomethingworld', - }, - }, - single_and_false: { - dsl: { - and: [ - { - custom_variable: { - eq: 'n_eq_value', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'eq_value', - }, - }, - }, - starts_with_operand: { - float_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123.456*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 123, - }, - }, - incorrect_key: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - neq: 'something', - }, - }, - incorrect_key_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - EQ: 'something', - }, - }, - single_char: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(zzsomethingzz*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'i', - }, - }, - case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'Something', - }, - }, - char_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(E*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'E', - }, - }, - prefix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'somethingdfgdwerewew', - }, - }, - boolean_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(true*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: true, - }, - }, - part_of_text: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(zzsomethingzz*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'something', - }, - }, - float_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123.456*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.456789, - }, - }, - null_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: null, - }, - }, - upper_case: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'HgUvshFRjsbTnvsdiUFFTGHFHGvDRT.YGHGH---A-N-Y-T-H-I-N-G---', - }, - }, - no_value_provided: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: '', - }, - }, - suffix_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'asdsdsdsomething', - }, - }, - boolean_data_type2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(false*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: false, - }, - }, - float_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.45, - }, - }, - numeric_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 12, - }, - }, - contains_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'asdn3kn42knsdsomethingmm', - }, - }, - char_data_type_case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(e*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'E', - }, - }, - special_characters: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'f25u!v@b#k$6%9^f&o*v(m)w_-=+s,./`(*&^%$#@!---A-N-Y-T-H-I-N-G---', - }, - }, - stringified_float: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123.456*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: '123.456789', - }, - }, - char_data_type_case_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(E*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'e', - }, - }, - boolean_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(true*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: false, - }, - }, - numeric_data_type_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123.0, - }, - }, - spaces: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(nice to see you. will you be my friend?*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'nice to see you. will you be my friend? Great!!', - }, - }, - mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'qwertyu', - }, - }, - exact_match: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 'something', - }, - }, - numeric_data_type: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(123*)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 123456, - }, - }, - boolean_data_type_mismatch: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(false*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: true, - }, - }, - missingkey_value: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: {}, - }, - case_mismatch2: { - dsl: { - or: [ - { - custom_variable: { - eq: 'wildcard(something*)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'SOMETHING', - }, - }, - }, - special_characters: { - test_special_character_pound: { - dsl: { - or: [ - { - custom_variable: { - eq: '€', - }, - }, - ], - }, - customVariables: { - eq: '€', - }, - expectation: true, - }, - }, - user_operand_evaluator: { - single_equal_return_true: { - dsl: { - and: [ - { - user: 'user_1', - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - }, - expectation: true, - }, - single_equal_return_false: { - dsl: { - and: [ - { - user: 'user_1', - }, - ], - }, - customVariables: { - _vwoUserId: 'user_2', - }, - expectation: false, - }, - multiple_equal_return_true: { - dsl: { - and: [ - { - user: 'user_1,user_3,user_2,user_4', - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - }, - expectation: true, - }, - multiple_equal_return_false: { - dsl: { - and: [ - { - user: 'user_1,user_3,user_2,user_4', - }, - ], - }, - customVariables: { - _vwoUserId: 'user_5', - }, - expectation: false, - }, - single_not_equal_return_true: { - dsl: { - and: [ - { - not: { - or: [ - { - user: 'user_1', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - single_not_equal_return_false: { - dsl: { - and: [ - { - not: { - or: [ - { - user: 'user_1', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - }, - expectation: false, - }, - multiple_not_equal_return_true: { - dsl: { - and: [ - { - not: { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - multiple_not_equal_return_false: { - dsl: { - and: [ - { - not: { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_2', - }, - expectation: false, - }, - single_not_equal_return_true_uneven_spaces: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user_1 ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - single_not_equal_return_false_uneven_spaces: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user_1 ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - }, - expectation: false, - }, - multiple_not_equal_return_true_uneven_spaces: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user_1 , user_2 , user_3 ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - multiple_not_equal_return_false_uneven_spaces: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user_1 , user_2 , user_3 ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_2', - }, - expectation: false, - }, - single_not_equal_return_true_spaces_in_user_id: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' space user ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - single_not_equal_return_false_spaces_in_user_id: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' space user ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'space user', - }, - expectation: false, - }, - multiple_not_equal_return_true_spaces_in_user_id: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' space user , space user , space user ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - }, - expectation: true, - }, - multiple_not_equal_return_false_spaces_in_user_id: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user_1 , space user , user_3 ', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'space user', - }, - expectation: false, - }, - }, - user_operand_evaluator_with_customVariables: { - targeting_safari_returns_true: { - dsl: { - or: [ - { - custom_variable: { - browser: 'safari', - }, - }, - ], - }, - expectation: true, - customVariables: { - browser: 'safari', - _vwoUserId: 'user_1', - }, - }, - targeting_safari_returns_false: { - dsl: { - not: { - or: [ - { - custom_variable: { - browser: 'safari', - }, - }, - ], - }, - }, - expectation: false, - customVariables: { - browser: 'safari', - _vwoUserId: 'user_1', - }, - }, - targeting_only_safari_for_user_1_returns_true: { - dsl: { - and: [ - { - and: [ - { - or: [ - { - user: 'user_1', - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - chrome: 'true', - }, - }, - ], - }, - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - safari: 'true', - }, - }, - ], - }, - { - or: [ - { - user: 'user_1', - }, - ], - }, - ], - }, - ], - }, - expectation: true, - customVariables: { - _vwoUserId: 'user_1', - chrome: false, - safari: true, - }, - }, - targeting_only_safari_for_user_1_returns_false: { - dsl: { - and: [ - { - and: [ - { - or: [ - { - user: 'user_1', - }, - ], - }, - { - not: { - or: [ - { - custom_variable: { - chrome: 'true', - }, - }, - ], - }, - }, - ], - }, - { - and: [ - { - or: [ - { - custom_variable: { - safari: 'true', - }, - }, - ], - }, - { - or: [ - { - user: 'user_1', - }, - ], - }, - ], - }, - ], - }, - expectation: false, - customVariables: { - _vwoUserId: 'user_1', - chrome: true, - safari: false, - }, - }, - targeting_chrome_all_version_with_black_listing_multiple_users_returns_true: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - browser: 'wildcard(chrome*)', - }, - }, - ], - }, - { - not: { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - browser: 'chrome 106.69', - }, - expectation: true, - }, - targeting_chome_any_version_with_multiple_users_returns_true: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - browser: 'wildcard(chrome*)', - }, - }, - ], - }, - { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - browser: 'chrome 107.107', - }, - expectation: true, - }, - targeting_chrome_all_version_with_black_listing_multiple_users_returns_false: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - browser: 'wildcard(chrome*)', - }, - }, - ], - }, - { - not: { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - }, - ], - }, - customVariables: { - _vwoUserId: 'user_2', - browser: 'chrome 106.69', - }, - expectation: false, - }, - targeting_chome_any_version_with_multiple_users_returns_false: { - dsl: { - and: [ - { - or: [ - { - custom_variable: { - browser: 'wildcard(chrome*)', - }, - }, - ], - }, - { - or: [ - { - user: 'user_1,user_2,user_3', - }, - ], - }, - ], - }, - customVariables: { - _vwoUserId: 'user_4', - browser: 'chrome 107.107', - }, - expectation: false, - }, - black_listing_scrambled_user_using_safari_return_false: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user _1 , space user , us er_3 ', - }, - ], - }, - and: [ - { - custom_variable: { - browser: 'safari', - }, - }, - ], - }, - ], - }, - customVariables: { - _vwoUserId: 'space user', - browser: 'safari', - }, - expectation: false, - }, - black_listing_scrambled_user_using_safari_return_true_for_space_difference: { - dsl: { - and: [ - { - not: { - or: [ - { - user: ' user _1 , space user , us er_3 ', - }, - ], - }, - and: [ - { - custom_variable: { - browser: 'safari', - }, - }, - ], - }, - ], - }, - customVariables: { - _vwoUserId: 'user_1', - browser: 'safari', - }, - expectation: true, - }, - }, - greater_than_operator: { - is_greater_than_operator_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gt(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 200, - }, - }, - is_greater_than_operator_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 50, - }, - }, - is_greater_than_operator_equal_values_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 100, - }, - }, - is_greater_than_operator_string_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'abc', - }, - }, - }, - less_than_operator: { - is_less_than_operator_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lt(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 50, - }, - }, - is_less_than_operator_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 150, - }, - }, - is_less_than_operator_equal_values_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 100, - }, - }, - is_less_than_operator_string_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lt(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'abc', - }, - }, - }, - greater_than_equal_to_operator: { - is_greater_than_equal_to_operator_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gte(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 150, - }, - }, - is_greater_than_equal_to_operator_equal_values_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gte(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 100, - }, - }, - is_greater_than_equal_to_operator_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gte(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 50, - }, - }, - is_greater_than_equal_to_operator_string_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'gte(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'abc', - }, - }, - }, - less_than_equal_to_operator: { - is_less_than_equal_to_operator_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lte(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 50, - }, - }, - is_less_than_equal_to_operator_equal_values_pass: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lte(100)', - }, - }, - ], - }, - expectation: true, - customVariables: { - eq: 100, - }, - }, - is_less_than_equal_to_operator_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lte(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 120, - }, - }, - is_less_than_equal_to_operator_string_fail: { - dsl: { - or: [ - { - custom_variable: { - eq: 'lte(100)', - }, - }, - ], - }, - expectation: false, - customVariables: { - eq: 'abc', - }, - }, - }, - }; -} diff --git a/test/data/settings/index.ts b/test/data/Settings.ts similarity index 50% rename from test/data/settings/index.ts rename to test/data/Settings.ts index 6e1f7c1..754aafb 100644 --- a/test/data/settings/index.ts +++ b/test/data/Settings.ts @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import * as TEST_SETTINGS_N_CASES from 'vwo-fme-sdk-e2e-test-settings-n-cases'; +import * as TESTS_DATA from 'vwo-fme-sdk-e2e-test-settings-n-cases'; -const BASIC_ROLLOUT_SETTINGS = TEST_SETTINGS_N_CASES.BASIC_ROLLOUT_SETTINGS; -const BASIC_ROLLOUT_TESTING_RULE_SETTINGS = TEST_SETTINGS_N_CASES.BASIC_ROLLOUT_TESTING_RULE_SETTINGS; -const NO_ROLLOUT_ONLY_TESTING_RULE_SETTINGS = TEST_SETTINGS_N_CASES.NO_ROLLOUT_ONLY_TESTING_RULE_SETTINGS; -const ROLLOUT_TESTING_PRE_SEGMENT_RULE_SETTINGS = TEST_SETTINGS_N_CASES.ROLLOUT_TESTING_PRE_SEGMENT_RULE_SETTINGS; -const TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS = TEST_SETTINGS_N_CASES.TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS; -const MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS = TEST_SETTINGS_N_CASES.MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS; -const MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS = TEST_SETTINGS_N_CASES.MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS; +const BASIC_ROLLOUT_SETTINGS = TESTS_DATA.BASIC_ROLLOUT_SETTINGS; +const BASIC_ROLLOUT_TESTING_RULE_SETTINGS = TESTS_DATA.BASIC_ROLLOUT_TESTING_RULE_SETTINGS; +const NO_ROLLOUT_ONLY_TESTING_RULE_SETTINGS = TESTS_DATA.NO_ROLLOUT_ONLY_TESTING_RULE_SETTINGS; +const ROLLOUT_TESTING_PRE_SEGMENT_RULE_SETTINGS = TESTS_DATA.ROLLOUT_TESTING_PRE_SEGMENT_RULE_SETTINGS; +const TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS = TESTS_DATA.TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS; +const MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS = TESTS_DATA.MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS; +const MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS = TESTS_DATA.MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS; -const TEST_DATA = TEST_SETTINGS_N_CASES.TEST_DATA; +const GETFLAG_TESTS = TESTS_DATA.GETFLAG_TESTS; export { BASIC_ROLLOUT_SETTINGS, @@ -33,6 +33,6 @@ export { TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS, MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS, MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS, - TEST_DATA, - TEST_SETTINGS_N_CASES, + GETFLAG_TESTS, + TESTS_DATA, }; diff --git a/test/data/settings/MegAdvanceAlgoCampaignSettings.ts b/test/data/settings/MegAdvanceAlgoCampaignSettings.ts deleted file mode 100644 index 74f9359..0000000 --- a/test/data/settings/MegAdvanceAlgoCampaignSettings.ts +++ /dev/null @@ -1,681 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const MEG_CAMPAIGN_ADVANCE_ALGO_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - variationId: 1, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule1', - }, - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - { - variationId: 2, - campaignId: 3, - type: 'FLAG_PERSONALIZE', - ruleKey: 'personalizeRule1', - }, - { - campaignId: 4, - type: 'FLAG_TESTING', - ruleKey: 'testingRule2', - }, - { - campaignId: 5, - type: 'FLAG_TESTING', - ruleKey: 'testingRule3', - }, - { - campaignId: 6, - type: 'FLAG_TESTING', - ruleKey: 'testingRule4', - }, - { - campaignId: 7, - type: 'FLAG_TESTING', - ruleKey: 'testingRule5', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - groups: { - '1': { - et: 2, - p: [4, 3], - campaigns: [3, 4, 6, 7], - wt: { - '6': 50, - '7': 50, - }, - name: 'Group 1', - }, - }, - campaignGroups: { - '3': 1, - '4': 1, - '6': 1, - '7': 1, - }, - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'rollout1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'rollout1', - }, - type: 'json', - }, - ], - id: 1, - segments: {}, - weight: 100, - name: 'Rollout-rule-1', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: { - or: [ - { - custom_variable: { - price: '100', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_personalizeRule1', - name: 'feature1_personalizeRule1', - id: 3, - isForcedVariationEnabled: false, - variations: [ - { - weight: 100, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'personalizeRule1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'personalizeRule1_variation', - }, - type: 'json', - }, - ], - segments: { - or: [ - { - custom_variable: { - name: 'personalise', - }, - }, - ], - }, - name: 'Personalize-rule-1', - }, - ], - segments: {}, - type: 'FLAG_PERSONALIZE', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule2', - name: 'feature1_testingRule2', - id: 4, - segments: { - or: [ - { - custom_variable: { - firstname: 'testingRule2', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing2', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing2_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule3', - name: 'feature1_testingRule3', - id: 5, - segments: { - or: [ - { - custom_variable: { - lastname: 'vwo', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing3', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing3', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing3_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing3_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule4', - name: 'feature1_testingRule4', - id: 6, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing4', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing4', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing4_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing4_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule5', - name: 'feature1_testingRule5', - id: 7, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing5', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing5', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing5_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing5_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/data/settings/MegRandomAlgoCampaignSettings.ts b/test/data/settings/MegRandomAlgoCampaignSettings.ts deleted file mode 100644 index 23281d4..0000000 --- a/test/data/settings/MegRandomAlgoCampaignSettings.ts +++ /dev/null @@ -1,484 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const MEG_CAMPAIGN_RANDOM_ALGO_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - variationId: 1, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule1', - }, - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - { - variationId: 2, - campaignId: 3, - type: 'FLAG_PERSONALIZE', - ruleKey: 'personalizeRule1', - }, - { - campaignId: 4, - type: 'FLAG_TESTING', - ruleKey: 'testingRule2', - }, - { - campaignId: 5, - type: 'FLAG_TESTING', - ruleKey: 'testingRule3', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - groups: { - '1': { - campaigns: [2, 3, 5], - name: 'Group 1', - }, - }, - campaignGroups: { - '2': 1, - '3': 1, - '5': 1, - }, - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'rollout1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'rollout1', - }, - type: 'json', - }, - ], - id: 1, - segments: {}, - weight: 100, - name: 'Rollout-rule-1', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: { - or: [ - { - custom_variable: { - price: '100', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_personalizeRule1', - name: 'feature1_personalizeRule1', - id: 3, - isForcedVariationEnabled: false, - variations: [ - { - weight: 100, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'personalizeRule1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'personalizeRule1_variation', - }, - type: 'json', - }, - ], - segments: { - or: [ - { - custom_variable: { - name: 'personalise', - }, - }, - ], - }, - name: 'Personalize-rule-1', - }, - ], - segments: {}, - type: 'FLAG_PERSONALIZE', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule2', - name: 'feature1_testingRule2', - id: 4, - segments: { - or: [ - { - custom_variable: { - firstname: 'testingRule2', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing2', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing2_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule3', - name: 'feature1_testingRule3', - id: 5, - segments: { - or: [ - { - custom_variable: { - lastname: 'vwo', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing3', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing3', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing3_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing3_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/data/settings/NoRolloutAndOnlyTestingSettings.ts b/test/data/settings/NoRolloutAndOnlyTestingSettings.ts deleted file mode 100644 index 6051ade..0000000 --- a/test/data/settings/NoRolloutAndOnlyTestingSettings.ts +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const NO_ROLLOUT_ONLY_TESTING_RULE_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: '{"name": "varun"}', - type: 'json', - }, - ], - id: 1, - segments: { - or: [ - { - custom_variable: { - price: 'gt(100)', - }, - }, - ], - }, - weight: 100, - name: 'Rollout-rule-1', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: '{"name": "varun"}', - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - variation: 1, - name: 'VWO', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/data/settings/OnlyRolloutSettings.ts b/test/data/settings/OnlyRolloutSettings.ts deleted file mode 100644 index ed06419..0000000 --- a/test/data/settings/OnlyRolloutSettings.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const BASIC_ROLLOUT_SETTINGS = { - accountId: 123456, - sdkKey: '000000000000_MASKED_000000000000', - version: 1, - features: [ - { - status: 'ON', - name: 'Feature1', - impactCampaign: {}, - rules: [ - { - ruleKey: 'rolloutRule1', - type: 'FLAG_ROLLOUT', - variationId: 1, - campaignId: 1, - }, - ], - type: 'FEATURE_FLAG', - metrics: [ - { - identifier: 'custom1', - mca: -1, - id: 1, - type: 'REVENUE_TRACKING', - }, - ], - id: 1, - key: 'feature1', - }, - ], - campaigns: [ - { - status: 'RUNNING', - variations: [ - { - variables: [ - { - value: 10, - type: 'integer', - id: 1, - key: 'int', - }, - { - value: 20.01, - type: 'double', - id: 2, - key: 'float', - }, - { - value: 'test', - type: 'string', - id: 3, - key: 'string', - }, - { - value: false, - type: 'boolean', - id: 4, - key: 'boolean', - }, - { - value: { name: 'VWO' }, - type: 'json', - id: 5, - key: 'json', - }, - ], - name: 'Rollout-rule-1', - segments: {}, - id: 1, - weight: 100, - }, - ], - segments: {}, - type: 'FLAG_ROLLOUT', - isForcedVariationEnabled: false, - id: 1, - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - }, - ], -}; diff --git a/test/data/settings/RolloutAndTestingSettings.ts b/test/data/settings/RolloutAndTestingSettings.ts deleted file mode 100644 index f1c4614..0000000 --- a/test/data/settings/RolloutAndTestingSettings.ts +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const BASIC_ROLLOUT_TESTING_RULE_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - variationId: 1, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule1', - }, - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: '{"name": "varun"}', - type: 'json', - }, - ], - id: 1, - segments: {}, - weight: 100, - name: 'Rollout-rule-1', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: '{"name": "varun"}', - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'test_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - variation: 1, - name: 'VWO', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/data/settings/RolloutAndTestingSettingsWithPreSegment.ts b/test/data/settings/RolloutAndTestingSettingsWithPreSegment.ts deleted file mode 100644 index afd51bb..0000000 --- a/test/data/settings/RolloutAndTestingSettingsWithPreSegment.ts +++ /dev/null @@ -1,367 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const ROLLOUT_TESTING_PRE_SEGMENT_RULE_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - variationId: 1, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule1', - }, - { - variationId: 2, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule2', - }, - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - { - campaignId: 3, - type: 'FLAG_TESTING', - ruleKey: 'testingRule2', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'rollout1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'rollout1', - }, - type: 'json', - }, - ], - id: 1, - segments: { - or: [ - { - custom_variable: { - price: '100', - }, - }, - ], - }, - weight: 100, - name: 'Rollout-rule-1', - }, - { - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'rollout1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'rollout2', - }, - type: 'json', - }, - ], - id: 2, - segments: { - or: [ - { - custom_variable: { - price: '200', - }, - }, - ], - }, - weight: 100, - name: 'Rollout-rule-2', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: { - or: [ - { - custom_variable: { - price: '100', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule2', - name: 'feature1_testingRule2', - id: 3, - segments: { - or: [ - { - custom_variable: { - price: '200', - }, - }, - ], - }, - isForcedVariationEnabled: false, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testin2', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2', - }, - type: 'json', - }, - ], - name: 'Default', - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing2_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing2_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/data/settings/SettingsWithWhitelisting.ts b/test/data/settings/SettingsWithWhitelisting.ts deleted file mode 100644 index d915f8e..0000000 --- a/test/data/settings/SettingsWithWhitelisting.ts +++ /dev/null @@ -1,217 +0,0 @@ -/** - * Copyright 2024 Wingify Software Pvt. Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const TESTING_WHITELISTING_SEGMENT_RULE_SETTINGS = { - features: [ - { - key: 'feature1', - name: 'Feature1', - metrics: [ - { - id: 1, - type: 'REVENUE_TRACKING', - identifier: 'custom1', - mca: -1, - }, - ], - rules: [ - { - variationId: 1, - type: 'FLAG_ROLLOUT', - campaignId: 1, - ruleKey: 'rolloutRule1', - }, - { - campaignId: 2, - type: 'FLAG_TESTING', - ruleKey: 'testingRule1', - }, - ], - type: 'FEATURE_FLAG', - impactCampaign: {}, - id: 1, - status: 'ON', - }, - ], - version: 1, - accountId: 12345, - sdkKey: '000000000000_MASKED_000000000000', - campaigns: [ - { - key: 'feature1_rolloutRule1', - name: 'feature1_rolloutRule1', - id: 1, - segments: {}, - isForcedVariationEnabled: false, - variations: [ - { - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'rollout1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'rollout1', - }, - type: 'json', - }, - ], - id: 1, - segments: { - or: [ - { - custom_variable: { - price: '100', - }, - }, - ], - }, - weight: 100, - name: 'Rollout-rule-1', - }, - ], - type: 'FLAG_ROLLOUT', - status: 'RUNNING', - }, - { - key: 'feature1_testingRule1', - name: 'feature1_testingRule1', - id: 2, - segments: { - or: [ - { - custom_variable: { - price: '200', - }, - }, - ], - }, - isForcedVariationEnabled: true, - variations: [ - { - weight: 50, - id: 1, - variables: [ - { - key: 'int', - id: 1, - value: 10, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.01, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: false, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1', - }, - type: 'json', - }, - ], - name: 'Default', - segments: { - or: [ - { - user: 'user_id,user_id_9', - }, - ], - }, - }, - { - weight: 50, - id: 2, - variables: [ - { - key: 'int', - id: 1, - value: 11, - type: 'integer', - }, - { - key: 'float', - id: 2, - value: 20.02, - type: 'double', - }, - { - key: 'string', - id: 3, - value: 'testing1_variation', - type: 'string', - }, - { - key: 'boolean', - id: 4, - value: true, - type: 'boolean', - }, - { - key: 'json', - id: 5, - value: { - campaign: 'testing1_variation', - }, - type: 'json', - }, - ], - name: 'Variation-1', - }, - ], - percentTraffic: 100, - type: 'FLAG_TESTING', - status: 'RUNNING', - }, - ], -}; diff --git a/test/e2e/GetFlag.test.ts b/test/e2e/GetFlag.test.ts index 12d5783..df54c1d 100644 --- a/test/e2e/GetFlag.test.ts +++ b/test/e2e/GetFlag.test.ts @@ -17,25 +17,25 @@ import { init } from '../../lib'; import { IVWOOptions } from '../../lib/models/VWOOptionsModel'; import { VWOBuilder } from '../../lib/VWOBuilder'; -import { TEST_SETTINGS_N_CASES, TEST_DATA } from '../data/settings'; +import { TESTS_DATA, GETFLAG_TESTS } from '../data/Settings'; import storageMap from '../data/StorageMap'; describe('VWO', () => { describe('getFLag without storage', () => { - runTests(TEST_DATA.GETFLAG_WITHOUT_STORAGE); + runTests(GETFLAG_TESTS.GETFLAG_WITHOUT_STORAGE); }); describe('getFLag with MEG - random Algo', () => { - runTests(TEST_DATA.GETFLAG_MEG_RANDOM); + runTests(GETFLAG_TESTS.GETFLAG_MEG_RANDOM); }); describe('getFlag with MEG - Advance algo', () => { - runTests(TEST_DATA.GETFLAG_MEG_ADVANCE); + runTests(GETFLAG_TESTS.GETFLAG_MEG_ADVANCE); }); describe('getFLag with storage', () => { - runTests(TEST_DATA.GETFLAG_WITH_STORAGE, storageMap); + runTests(GETFLAG_TESTS.GETFLAG_WITH_STORAGE, storageMap); }); }); @@ -54,7 +54,7 @@ async function runTests(tests, storageMap?: any) { } const vwoBuilder = new VWOBuilder(vwoOptions); - jest.spyOn(vwoBuilder, 'getSettings').mockResolvedValue(TEST_SETTINGS_N_CASES[testData.settings] as any); + jest.spyOn(vwoBuilder, 'getSettings').mockResolvedValue(TESTS_DATA[testData.settings] as any); const options = { sdkKey: 'sdk-key', diff --git a/test/e2e/SetAttribute.test.ts b/test/e2e/SetAttribute.test.ts index 6fcdaf1..2c6a759 100644 --- a/test/e2e/SetAttribute.test.ts +++ b/test/e2e/SetAttribute.test.ts @@ -15,7 +15,7 @@ */ import { init } from '../../lib'; import { VWOBuilder } from '../../lib/VWOBuilder'; -import { BASIC_ROLLOUT_SETTINGS } from '../data/settings'; +import { BASIC_ROLLOUT_SETTINGS } from '../data/Settings'; import { SetAttributeApi } from '../../lib/api/SetAttribute'; import { getEventsBaseProperties, getAttributePayloadData, sendPostApiRequest } from '../../lib/utils/NetworkUtil'; diff --git a/test/e2e/TrackEvent.test.ts b/test/e2e/TrackEvent.test.ts index 99e0f9e..e9a0484 100644 --- a/test/e2e/TrackEvent.test.ts +++ b/test/e2e/TrackEvent.test.ts @@ -15,7 +15,7 @@ */ import { init } from '../../lib'; import { VWOBuilder } from '../../lib/VWOBuilder'; -import { BASIC_ROLLOUT_SETTINGS } from '../data/settings'; +import { BASIC_ROLLOUT_SETTINGS } from '../data/Settings'; describe('VWOClient trackEvent method', () => { let options; diff --git a/test/unit/modules/decision-maker/DecisionMaker.test.ts b/test/unit/packages/decision-maker/DecisionMaker.test.ts similarity index 100% rename from test/unit/modules/decision-maker/DecisionMaker.test.ts rename to test/unit/packages/decision-maker/DecisionMaker.test.ts diff --git a/test/unit/modules/logger/Logger.test.ts b/test/unit/packages/logger/Logger.test.ts similarity index 100% rename from test/unit/modules/logger/Logger.test.ts rename to test/unit/packages/logger/Logger.test.ts diff --git a/test/unit/modules/networking/Network.test.ts b/test/unit/packages/network-layer/Network.test.ts similarity index 100% rename from test/unit/modules/networking/Network.test.ts rename to test/unit/packages/network-layer/Network.test.ts diff --git a/test/unit/modules/segmentor/Segmentation.test.ts b/test/unit/packages/segmentation-evaluator/Segmentation.test.ts similarity index 67% rename from test/unit/modules/segmentor/Segmentation.test.ts rename to test/unit/packages/segmentation-evaluator/Segmentation.test.ts index 54a0eb7..4860ec0 100644 --- a/test/unit/modules/segmentor/Segmentation.test.ts +++ b/test/unit/packages/segmentation-evaluator/Segmentation.test.ts @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import * as TESTS_DATA from 'vwo-fme-sdk-e2e-test-settings-n-cases'; + import { SegmentEvaluator } from '../../../../lib/packages/segmentation-evaluator'; -import { SegmentEvaluatorData } from '../../../data/SegmentEvaluatorData'; describe('Segmentation', () => { test('and operator test', async () => { - const andOperatorkey = Object.keys(new SegmentEvaluatorData().data['and_operator']); - const andOperatorDsl = new SegmentEvaluatorData().data['and_operator']; + const andOperatorkey = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['and_operator']); + const andOperatorDsl = TESTS_DATA.SEGMENTATION_TESTS['and_operator']; andOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = andOperatorDsl[key]; @@ -31,9 +32,9 @@ describe('Segmentation', () => { test('case insensitive equality operand test', async () => { const andOperatorkey: Array = Object.keys( - new SegmentEvaluatorData().data['case_insensitive_equality_operand'], + TESTS_DATA.SEGMENTATION_TESTS['case_insensitive_equality_operand'], ); - const andOperatorDsl = new SegmentEvaluatorData().data['case_insensitive_equality_operand']; + const andOperatorDsl = TESTS_DATA.SEGMENTATION_TESTS['case_insensitive_equality_operand']; andOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = andOperatorDsl[key]; @@ -44,8 +45,8 @@ describe('Segmentation', () => { }); test('complex and ors test', async () => { - const complexOperatorkey: Array = Object.keys(new SegmentEvaluatorData().data['complex_and_ors']); - const complexOperatorDsl = new SegmentEvaluatorData().data['complex_and_ors']; + const complexOperatorkey: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['complex_and_ors']); + const complexOperatorDsl = TESTS_DATA.SEGMENTATION_TESTS['complex_and_ors']; complexOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = complexOperatorDsl[key]; @@ -56,8 +57,8 @@ describe('Segmentation', () => { }); test('complex dsl test', async () => { - let complexDSLOperatorkey = Object.keys(new SegmentEvaluatorData().data['complex_dsl_1']); - let complexDSLOperatorDsl = new SegmentEvaluatorData().data['complex_dsl_1']; + let complexDSLOperatorkey = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_1']); + let complexDSLOperatorDsl = TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_1']; complexDSLOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = complexDSLOperatorDsl[key]; @@ -66,8 +67,8 @@ describe('Segmentation', () => { expect(preSegmentationResult).toBe(expectation); }); - complexDSLOperatorkey = Object.keys(new SegmentEvaluatorData().data['complex_dsl_2']); - let complexDSLOperatorDsl1 = new SegmentEvaluatorData().data['complex_dsl_2']; + complexDSLOperatorkey = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_2']); + let complexDSLOperatorDsl1 = TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_2']; complexDSLOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = complexDSLOperatorDsl1[key]; @@ -76,8 +77,8 @@ describe('Segmentation', () => { expect(preSegmentationResult).toBe(expectation); }); - complexDSLOperatorkey = Object.keys(new SegmentEvaluatorData().data['complex_dsl_3']); - let complexDSLOperatorDsl2 = new SegmentEvaluatorData().data['complex_dsl_3']; + complexDSLOperatorkey = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_3']); + let complexDSLOperatorDsl2 = TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_3']; complexDSLOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = complexDSLOperatorDsl2[key]; @@ -86,8 +87,8 @@ describe('Segmentation', () => { expect(preSegmentationResult).toBe(expectation); }); - complexDSLOperatorkey = Object.keys(new SegmentEvaluatorData().data['complex_dsl_4']); - let complexDSLOperatorDsl3 = new SegmentEvaluatorData().data['complex_dsl_4']; + complexDSLOperatorkey = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_4']); + let complexDSLOperatorDsl3 = TESTS_DATA.SEGMENTATION_TESTS['complex_dsl_4']; complexDSLOperatorkey.forEach(async (key) => { const { dsl, expectation, customVariables } = complexDSLOperatorDsl3[key]; @@ -98,8 +99,8 @@ describe('Segmentation', () => { }); test('contains operand test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['contains_operand']); - const operatorDsl = new SegmentEvaluatorData().data['contains_operand']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['contains_operand']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['contains_operand']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -110,8 +111,8 @@ describe('Segmentation', () => { }); test('ends operand test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['ends_with_operand']); - const operatorDsl = new SegmentEvaluatorData().data['ends_with_operand']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['ends_with_operand']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['ends_with_operand']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -122,8 +123,8 @@ describe('Segmentation', () => { }); test('equality operand test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['equality_operand']); - const operatorDsl = new SegmentEvaluatorData().data['equality_operand']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['equality_operand']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['equality_operand']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -134,8 +135,8 @@ describe('Segmentation', () => { }); test('new cases for decimal mismatch test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['new_cases_for_decimal_mismatch']); - const operatorDsl = new SegmentEvaluatorData().data['new_cases_for_decimal_mismatch']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['new_cases_for_decimal_mismatch']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['new_cases_for_decimal_mismatch']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -146,8 +147,8 @@ describe('Segmentation', () => { }); test('not operator test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['not_operator']); - const operatorDsl = new SegmentEvaluatorData().data['not_operator']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['not_operator']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['not_operator']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -158,8 +159,8 @@ describe('Segmentation', () => { }); test('or operator test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['or_operator']); - const operatorDsl = new SegmentEvaluatorData().data['or_operator']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['or_operator']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['or_operator']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -170,8 +171,8 @@ describe('Segmentation', () => { }); test('regex test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['regex']); - const operatorDsl = new SegmentEvaluatorData().data['regex']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['regex']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['regex']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -182,8 +183,8 @@ describe('Segmentation', () => { }); test('simple and ors test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['simple_and_ors']); - const operatorDsl = new SegmentEvaluatorData().data['simple_and_ors']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['simple_and_ors']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['simple_and_ors']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -194,8 +195,8 @@ describe('Segmentation', () => { }); test('starts with operand test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['starts_with_operand']); - const operatorDsl = new SegmentEvaluatorData().data['starts_with_operand']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['starts_with_operand']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['starts_with_operand']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -206,8 +207,8 @@ describe('Segmentation', () => { }); test('special characters test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['special_characters']); - const operatorDsl = new SegmentEvaluatorData().data['special_characters']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['special_characters']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['special_characters']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -218,8 +219,8 @@ describe('Segmentation', () => { }); test('user operand evaluator test', async () => { - const operatorkeys: Array = Object.keys(new SegmentEvaluatorData().data['user_operand_evaluator']); - const operatorDsl = new SegmentEvaluatorData().data['user_operand_evaluator']; + const operatorkeys: Array = Object.keys(TESTS_DATA.SEGMENTATION_TESTS['user_operand_evaluator']); + const operatorDsl = TESTS_DATA.SEGMENTATION_TESTS['user_operand_evaluator']; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = operatorDsl[key]; @@ -231,11 +232,11 @@ describe('Segmentation', () => { test('user operand evaluator with customVariables test', async () => { const operatorkeys: Array = Object.keys( - new SegmentEvaluatorData().data['user_operand_evaluator_with_customVariables'], + TESTS_DATA.SEGMENTATION_TESTS['user_operand_evaluator_with_customVariables'], ); const dslKey = 'user_operand_evaluator_with_customVariables'; - const evaluatingDsl = new SegmentEvaluatorData().data[dslKey]; + const evaluatingDsl = TESTS_DATA.SEGMENTATION_TESTS[dslKey]; operatorkeys.forEach(async (key) => { const { dsl, expectation, customVariables } = evaluatingDsl[key]; diff --git a/yarn.lock b/yarn.lock index f5606c6..f6b2a05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4803,10 +4803,10 @@ vscode-textmate@^8.0.0: resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-8.0.0.tgz#2c7a3b1163ef0441097e0b5d6389cd5504b59e5d" integrity sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg== -vwo-fme-sdk-e2e-test-settings-n-cases@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vwo-fme-sdk-e2e-test-settings-n-cases/-/vwo-fme-sdk-e2e-test-settings-n-cases-1.0.1.tgz#ea9c7eeb427cc1537fa7b3882a9739ede198a27a" - integrity sha512-qnY68XFH9lXLnWQCo0IpTVVy0ej7+0qgFOKsxdDF8dLqorBdrLSRIfsqnM83FoBKatQ90DBBrTfUxnDKHy1sQg== +vwo-fme-sdk-e2e-test-settings-n-cases@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vwo-fme-sdk-e2e-test-settings-n-cases/-/vwo-fme-sdk-e2e-test-settings-n-cases-1.1.1.tgz#e92f83fb103ef64e3925949aa0c4010d6537a336" + integrity sha512-gZomw5uC2SV06y/oyXg0iT/gO78h5LYmE3WI1bE68GuoPwYYKL6IpUFd3bNBTU20rPB62rJuOiRgZ+mD4rvEgA== vwo-fme-sdk-log-messages@^0.1.2: version "0.1.2"