You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ca14c09
Browse filesBrowse the repository at this point in the historyBrowse files
test('rejects a clock read in a hook body',async()=>{
591
+
expect(
592
+
awaitrenderClockMessages('src/hooks/sample.ts','export function useSample() { return Date.now(); }'),
593
+
).toEqual([
594
+
'Read the current time with useNow during render, so the server and the client agree. Date.now() and new Date() belong in effects, event handlers and machine actions.',
595
+
]);
596
+
});
597
+
598
+
test.each([
599
+
['a component body','export function Sample() { const now = new Date(); return now.getTime(); }'],
'Read the current time with useNow during render, so the server and the client agree. Date.now() and new Date() belong in effects, event handlers and machine actions.',
0 commit comments