There are no formal medical tests to diagnose sleep paralysis.
Your healthcare professional will usually ask about your sleep patterns and experience falling asleep or waking up. 
They will take a look at your medical history and may also ask you to keep a sleep diary of any paralysis episodes.
Other conditions, like narcolepsy or an atonic seizure, present with similar symptoms to sleep paralysis, so your doctor will base their diagnosis on your description of an episode or episodes.