test(web): the Quebec cases of the parity test restore the zone they found (#201)
Their afterEach wrote `UTC` back, so they could stand in for the first statement of the file: with that statement removed, the parity cases that ran after them still passed (found by mutation, one red test instead of five). The hook now restores the zone read when the file is collected. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
fa0bec2fcd
commit
29d0f22c9c
1 changed files with 7 additions and 1 deletions
|
|
@ -83,8 +83,14 @@ describe('nextOccurrence of the companion against getNextOccurrence of the app,
|
|||
// app keeps the local time and the day of the local month, the companion the
|
||||
// UTC time and the day of the UTC month.
|
||||
describe('in Quebec (America/Toronto), the companion and the app differ', () => {
|
||||
// Each test sets the zone of Quebec, then the zone of the file comes back:
|
||||
// the one its first statement set, read here and not written again, so that
|
||||
// these tests cannot stand in for that statement.
|
||||
const zone = process.env.TZ;
|
||||
|
||||
afterEach(() => {
|
||||
process.env.TZ = 'UTC';
|
||||
if (zone === undefined) delete process.env.TZ;
|
||||
else process.env.TZ = zone;
|
||||
});
|
||||
|
||||
// [due date, recurrence, next occurrence of the companion, of the app]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue