File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
ab-testing/config/scripts/validation Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ export function allExpirationsValid(tests: ABTest[]): boolean {
1414 }
1515
1616 /**
17- * Check if the input date matches the JS interpreted date to check it is valid
18- * If the input !== output date, we throw an error to highlight the date set is not
19- * the actual expiration date of the test
17+ * Converts the expiration date to a `Date` object and then back into a string
18+ * This is to confirm Javascript interprets the input the same way humans do
19+ * If there's a difference, we throw an error to highlight the discrepancy
20+ * @example `2026-02-30` is interpreted as `2026-03-02` so this fails
21+ * @example `2026-01-30` is interpreted as `2026-01-30` so this passes
2022 */
2123 const interpretedExpirationDate = new Date ( test . expirationDate )
2224 . toISOString ( )
You can’t perform that action at this time.
0 commit comments