The House Wednesday voted 252-159 to ban any Star Wars tests that would violate the 1972 Anti-Ballistic Missile treaty, despite strong opposition by President Reagan.

The vote came as the Democratic-controlled chamber began working on a huge bill authorizing the Pentagon budget for the fiscal year starting Oct. 1.In effect, the vote requires Reagan to adhere to the so-called narrow interpretation of the ABM pact, even though the president asserts he has the legal right to move to a broad view that would allow expanded Star Wars testing.

"This is unilateral disarmament of a benign, but nonetheless serious, sort," said Rep. Henry Hyde, R-Ill., a critic of the ABM restriction.

But Rep. John Spratt, D-S.C., said, "what we're talking about is simply the same interpretation of the ABM treaty that's been taken by every president since it was ratified."

The White House had lobbied against the ABM restriction and also opposed another arms control restriction backed by Democrats.

The second restriction would ban spending for any weapons that would violate the numerical limits on various categories of atomic weapons contained in the 1979 SALT II treaty. Reagan says the Soviets are violating the unratified pact and thus he will no longer follow it when deciding which U.S. weapons to build.

Both amendments were added to last year's Pentagon budget bill on votes which went largely along party lines. But they were later altered in conference committee.

The ABM fight arises from Reagan's contention that he can unilaterally change how a treaty is legally interpreted by the United States. Although Reagan has asserted such a right legally exists, he has chosen not to exercise it.

Congressional Democrats dispute Reagan's assertion, arguing that a treaty cannot be changed without approval of the Senate, which must ratify such pacts before they become effective.