Create expectedLightState inside BeforeEach to avoid race conditions.