hooks: useSkyState test imports the hook statically
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 4m34s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-26 18:41:02 +01:00
commit 19493812c1

View file

@ -1,5 +1,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { setSkyClock } from '../features/scene/skyState';
import { useSkyMinute } from './useSkyState';
// useSkyMinute is state and one effect: react is held so the effect can be run and cleaned up by hand.
const held = vi.hoisted(() => ({
@ -18,7 +19,6 @@ vi.mock('react', async (importOriginal) => {
};
return { ...actual, useState, useEffect };
});
const { useSkyMinute } = await import('./useSkyState');
const at = (iso: string) => setSkyClock(() => new Date(iso));
beforeEach(() => {