Heavy-equipment manufacturer Cummins has debuted an all-electric semi truck just weeks before Tesla is expected to unveil its own.