The person you sleep with may see it before you do. In other cases, the diagnosis is made with the use of an overnight sleep test. This test is often used to figure daytime sleepiness or why you might wake up a lot at night. Blood work may be done to see levels of iron, folic acid, vitamin B12, and magnesium, as well as thyroid function.