Here are 6 Bible verses about testing spirits from the Old and New Testaments of the Holy Bible (King James Version), sorted from most to least relevant.
1 Corinthians 12:10 KJV
To another the working of miracles; to another prophecy; to another discerning of spirits; to another divers kinds of tongues; to another the interpretation of tongues:
1 John 4:1 KJV
Beloved, believe not every spirit, but try the spirits whether they are of God: because many false prophets are gone out into the world.
1 Thessalonians 5:21 KJV
Prove all things; hold fast that which is good.
Acts 17:11 KJV
These were more noble than those in Thessalonica, in that they received the word with all readiness of mind, and searched the scriptures daily, whether those things were so.
1 John 4:2-6 KJV
Hereby know ye the Spirit of God: Every spirit that confesseth that Jesus Christ is come in the flesh is of God: And every spirit that confesseth not that Jesus Christ is come in the flesh is not of God: and this is that spirit of antichrist, whereof ye have heard that it should come; and even now already is it in the world. Ye are of God, little children, and have overcome them: because greater is he that is in you, than he that is in the world. They are of the world: therefore speak they of the world, and the world heareth them. We are of God: he that knoweth God heareth us; he that is not of God heareth not us. Hereby know we the spirit of truth, and the spirit of error.
2 Timothy 3:15-17 KJV
And that from a child thou hast known the holy scriptures, which are able to make thee wise unto salvation through faith which is in Christ Jesus. All scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: That the man of God may be perfect, throughly furnished unto all good works.