Edit, to add: I initially cited to the King James-translation as that has historically been the most promulgated version of the gospels.
And there's a lot of magic in the apocrypha (which, despite having been removed from canon, does reflect the diversity in Christian belief at the time) such as the angel who teaches astrology and spells to drive away demons in the Book of Tobit, or Solomon using a magic ring to control demons in the Testament of Solomon, or the wizard battle in the Acts of Peter.
I think we need to be careful in how we are using words like "astrology" and "spells", since it is easy to group many ideas under those umbrellas in a way that people living long ago wouldn't have.
For a start, I don't see any mention in Tobit chapter 6 of astrology[0], and the technique given for driving away a particular demon is "thou shalt take the ashes of perfume, and shalt lay upon them some of the heart and liver of the fish, and shalt make a smoke with it: And the devil shall smell it, and flee away, and never come again any more" followed by "and pray to God".
We wouldn't say that someone is casting a spell if they used cayenne pepper to keep cats away from their garden, and early readers of Tobit wouldn't have considered fish organs to be an unholy or forbidden substance. For a process to deserve the designation of a "spell", it would have to involve either a means or an ends that was forbidden by God.
I also read it as the witch being surprised when the spirit actually shows up...
The OT, as I further understand, contains a number of different prohibitions of very specific magical practices in the source language, most of which are highly genericized in most English translations.
(There's also a specific enumeration of the parts of the Jewish law that remain in force for Christians in Acts 15, and most of the probibitions under discussion here don't fall within its scope.)