Commit b3b2f89
authored
Runtime rules engine ⚙️ (#249)
* extract var for test values
* mark old runtime rules as legacy
* succint flag setup to one line
* DRY tests with helper - more succint
* DRY context creation for runtime
* use random string for clarity on wrong values
* DRY fallback
* runtime rule negative case ❌
* add stopgap positive test case (doesn't fail)
* import jsonLogic and evaluate runtime rule ✅
* caseinsensitive to parameters
Still need caseinsensitive on rule
* case-insensitivity ✅
* add complex rule test-cases ✅
* consistent runtime rule test names
* add error handling for garbled jsonlogic
* add multi-condition case-insensitive check
* pretty
* Apply simple suggestions from code review
Co-authored-by: teddddd <ted@mixpanel.com>
* prevent randomString() from accidental matches
* consolidate lowercasing of json objects
* assert that variant is returned, not just NOT fallback
* dry variant-returned assertion
* add test for case-insensitive runtime param keys
* add "in" negative case for substring & superstring
* prettier
* Update test/flags/local_flags.js
* move helper func to top of test file
* prettier1 parent 323980c commit b3b2f89
5 files changed
Lines changed: 499 additions & 205 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
319 | 344 | | |
320 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
321 | 350 | | |
322 | 351 | | |
| 352 | + | |
323 | 353 | | |
324 | | - | |
325 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
326 | 357 | | |
327 | 358 | | |
328 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
73 | 102 | | |
74 | 103 | | |
75 | 104 | | |
76 | 105 | | |
77 | 106 | | |
78 | 107 | | |
| 108 | + | |
| 109 | + | |
79 | 110 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
0 commit comments