Chesterfield began their home pre-season campaign with a 2-1 victory over Championship side Huddersfield at the Proact Stadium.