To assess the accuracy of hybrid functional and many-body GW methods, we study the band offsets for a set of lattice-matched semiconductor heterojunctions, including AlAs/GaAs(100), AlP/GaP(100), Si/GaP(110), Ge/GaAs(110), Ge/AlAs(110), Ge/ZnSe(110), and ZnSe/GaAs(110). The band-edge positions are first obtained for the bulk semiconductors and then aligned through the lineup of a local reference potential at the interface. The band-edge positions critically depend on the electronic-structure method, while the interface dipole is already well accounted for with semilocal density functionals. The two advanced electronic-structure schemes yield consistent valence-band offsets in close agreement with experiment, slightly improving upon semilocal functionals. At variance, conduction-band offsets are subject to larger deviations and improve with the accuracy of the calculated band gaps. In case one is willing to take band gaps from experiment, the best description of the band alignment for the present heterojunctions is achieved by relying on the calculated valence band offsets rather than on hybrid functionals in which the exchange mixing parameter is adjusted.