Skip to content

Commit 4851315

Browse files
authored
add callout to include timezone (#27)
1 parent 9f4053c commit 4851315

File tree

1 file changed

+2
-0
lines changed
  • exercises/02.test-structure/04.solution.hooks

1 file changed

+2
-0
lines changed

exercises/02.test-structure/04.solution.hooks/README.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Then, I go to the `greet.test.ts` and add the `beforeAll()` hook that patches th
2020

2121
<CodeFile file="greet.test.ts" range="3-9" highlight="3,6-8" />
2222

23+
<callout-warning>I recommend providing an entire UTC date, including an explicit timezone, as the value of the mocked date to have a resilient test setup: `new OriginalDate('2024-01-01 00:00:00.000Z')`</callout-warning>
24+
2325
Similarly, I make sure to clean up this `Date` mock in the `afterAll()` hook:
2426

2527
<CodeFile file="greet.test.ts" range="11-13" highlight="12" />

0 commit comments

Comments
 (0)