A legal challenge will examine whether Boris Johnson could be jailed if he pushes through a no-deal Brexit.