Some of the expected dates in limits.test.ts are timezone-naive. Depending on the system time they may fail. They fail when running here on EST, or any negative UTC offset. Meanwhile they work for positive UTC offset (so most of the Rafiki team, who are in Europe). These have always failed for me and I'm just now figuring them out.
You can verify this failing behavior by traveling to New York and then running the tests. Or by setting the timezone when running the tests:
TZ=America/New_York pnpm -F backend test packages/backend/src/open_payments/payment/outgoing/limits.test.ts
Likewise, I can set the timezone to UTC to make them pass on my machine (when they normally fail):
TZ=UTC pnpm -F backend test packages/backend/src/open_payments/payment/outgoing/limits.test.ts
The fix is simply to make the dates timezone-aware by including the Z in the date string, as all the other cases do.
Some of the expected dates in
limits.test.tsare timezone-naive. Depending on the system time they may fail. They fail when running here on EST, or any negative UTC offset. Meanwhile they work for positive UTC offset (so most of the Rafiki team, who are in Europe). These have always failed for me and I'm just now figuring them out.You can verify this failing behavior by traveling to New York and then running the tests. Or by setting the timezone when running the tests:
Likewise, I can set the timezone to UTC to make them pass on my machine (when they normally fail):
The fix is simply to make the dates timezone-aware by including the
Zin the date string, as all the other cases do.