The Apollo 1 accident[0] was during a similar test (a "plugs out test", which tests the spacecraft independent of all the support systems on earth to verify that it works correctly on its own). The rationale behind all this tests is "better have a problem on the ground, where we can fix it, than have the spacecraft fail in space".
If you get interest in this stuff, the HBO miniseries "From the Earth to the Moon" has an episode about Apollo1 (and the series as a whole, though slightly dated on the FX side, is amazing).
[0] https://en.wikipedia.org/wiki/Apollo_1