One of the 787 test aircraft was struck by lightning last year, with no damage.
Being hit by lightning is not part of flight test though, you certify for that through analysis and getting some components exposed in a simulated lightning test laboratory.