PhilanthropyDataCommons / service

A project for collecting and serving public information associated with grant applications
GNU Affero General Public License v3.0
8 stars 2 forks source link

Update tests: database can sometimes return a timestamp with fewer significant digits #906

Closed slifty closed 5 months ago

slifty commented 5 months ago

We had CI fail: https://github.com/PhilanthropyDataCommons/service/actions/runs/8666216237/job/23766547108?pr=896

    @@ -1,7 +1,7 @@
      Object {
    -   "createdAt": StringMatching /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3,6})?(Z|(\+|-)\d{2}:\d{2})$/,
    +   "createdAt": "2024-04-12T18:11:26.18+00:00",
        "dataType": "string",
        "description": "😍",
        "id": Any<Number>,
        "label": "🏷️",
        "shortCode": "🩳",

It's because 11:26.18 doesn't match d{2}:\d{2}(\.\d{3,6})? because .18 doesn't match d{3,6}

I think the solution is to update d{3,6} to d{1,6}