There’s no single test that can be done to diagnose insomnia, but a doctor may perform blood tests to check if thyroid issues, low iron, or other health conditions are playing a role in your insomnia.