mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 22:32:04 +00:00
Hold the due phrase to the profile clock and to whole calendar days
Moves the host zone under the function to prove the answer does not follow it, since the suite otherwise runs pinned to UTC and would not have noticed. Adds the two days a year that are not twenty-four hours long, where counting hours rounds the evening into tomorrow. The structural check that the shared body never reads the device clock was looking for the wrong shape and let a deliberate break through; it now looks for the word itself.
This commit is contained in:
1 parent
e1ca6d9da2
commit
d0a42908fe
2 files changed
+74
-3
No files matched your search
@@ -138,11 +138,16 @@ describe("the due-day bucket asks the same clock as the date beside it", () => {
|
||||
// `startOfLocalDayInTz(instant, undefined)` means "whatever zone this
|
||||
// machine is set to". That is the reading the phrase used to take while
|
||||
// the date next to it took the profile zone.
|
||||
//
|
||||
// The check is the bare word rather than a shape like
|
||||
// `startOfLocalDayInTz(…, undefined)`, because the first draft of it
|
||||
// matched only the inline form and sailed straight past a mutation that
|
||||
// put the same `undefined` in a variable one line up. There is no honest
|
||||
// use for the word in a file whose whole job is to name a zone; if one
|
||||
// ever appears, that is worth coming here and arguing for.
|
||||
const home = read(HOME);
|
||||
|
||||
expect(home, FIX_THE_ZONE).not.toMatch(
|
||||
/startOfLocalDayInTz\([^)]*undefined/,
|
||||
);
|
||||
expect(home, FIX_THE_ZONE).not.toContain("undefined");
|
||||
});
|
||||
|
||||
it("takes the zone as an argument with no default to fall back on", () => {
|
||||
|
||||
Reference in new issue
Block a user