Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 17, 2024
1 parent 9c2cb7e commit 16789de
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[
{
"name": "Nieuwjaar",
"date": "2024-01-01T00:00:00.000000Z"
"date": "2024-01-01"
},
{
"name": "Paasmaandag",
"date": "2024-03-31T22:00:00.000000Z"
"date": "2024-04-01"
},
{
"name": "Dag van de Arbeid",
"date": "2024-05-01T00:00:00.000000Z"
"date": "2024-05-01"
},
{
"name": "OLH Hemelvaart",
"date": "2024-05-08T22:00:00.000000Z"
"date": "2024-05-09"
},
{
"name": "Pinkstermaandag",
"date": "2024-05-19T22:00:00.000000Z"
"date": "2024-05-20"
},
{
"name": "Nationale Feestdag",
"date": "2024-07-21T00:00:00.000000Z"
"date": "2024-07-21"
},
{
"name": "OLV Hemelvaart",
"date": "2024-08-15T00:00:00.000000Z"
"date": "2024-08-15"
},
{
"name": "Allerheiligen",
"date": "2024-11-01T00:00:00.000000Z"
"date": "2024-11-01"
},
{
"name": "Wapenstilstand",
"date": "2024-11-11T00:00:00.000000Z"
"date": "2024-11-11"
},
{
"name": "Kerstmis",
"date": "2024-12-25T00:00:00.000000Z"
"date": "2024-12-25"
}
]
2 changes: 1 addition & 1 deletion tests/Countries/BelgiumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
->toBeArray()
->not()->toBeEmpty();

expect($holidays)->toMatchSnapshot();
expect(formatDates($holidays))->toMatchSnapshot();
});
9 changes: 9 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@

test()->fail('Failed asserting that the array contains the expected subarray.');
});

function formatDates(array $holidays): array
{
foreach ($holidays as &$holiday) {
$holiday['date'] = $holiday['date']->format('Y-m-d');
}

return $holidays;
}

0 comments on commit 16789de

Please sign in to comment.