1 John 4 1-3 (New American Standard Bible)
1 Beloved, do not believe every spirit, but test the spirits to see whether they are from God, because many false prophets have gone out into the world. 2 By this you know the Spirit of God: every spirit that confesses that Jesus Christ has come in the flesh is from God; 3 and every spirit that does not confess Jesus is not from God; this is the spirit of the antichrist, which you have heard is coming, and now it is already in the world.
This passage begins by warning us not to trust any old spirit that may come along, but to test them, as many times spirits have lead people into either being or following false prophets.
It says that just because it is a spirit doesn't mean that it is necessarily good or from God, it says there are plenty of wicked spirits in circulation
It then says that if a spirit confesses Jesus is came in the flesh is from God, and that if it doesn't then it is not from God. And that that is how you can test - basically, whether or not they say Christ is both divine and human - i.e. testify to his true nature!
He then talks about "the spirit of the anti-christ" - I believe this spirit is to Satan as The Holy Spirit is to God.
The historical context of this passage is that it was written with competing religions in mind - most noticeably gnosticism, which at that time strongly rivalled Christianity and did not agree with Christian Christology. Although gnosticism covered a large range of beliefs here is not the time to go into these. But the point is, they mostly denied that Jesus was God incarnate. i.e. both human and divine.
These verses are also consistent with the belief that Satan's job is twofold. First, to deny Christ is of/from God and secondly, to present alternatives to Christ. He doesn't want people to know Christ and he tries to stop them knowing, whilst positing alternatives to him - counterfeit alternatives.
At its core, if affirms the notion that Jesus was God incarnated as a human being and says that the test as to whether or not a spirit is from God is to see whether it believes Jesus was God incarnated - as opposed to either just a man, or exclusively God. Which is to say that the test is whether or not what it says corresponds to Christian doctrine.
What This Means To Me
In the past I have allowed myself to be mislead and made a fool of by "the spirit of the anti-christ"
Although this spirit never denied Christ it has lead me away from Christ and towards false teachings, which he achieved by mis-representing his true nature to me.
For instance, for many months it encouraged me to believe in Simulation Theory - the notion that this reality and all of us who are in it are parts fo a simulation. Sounds rather harmless, if not a tad far-fetched. But it is more sinister. It presents an alternative world view to that which is offered by Christianity: The two cannot be reconciled. By accepting one you reject the other. That is one way in which the wicked spirit who haunts me has tried to mislead me and keep me from knowing Jesus and building my life around him. In Simulation Theory there is no room for salvation!
If this spirit that haunts me had not affirmed Simulation Theory to be true then there may be grounds for arguing that it is from God. However, it has clearly said that Simulation Theory is true - which in my mind constitutes it leading me away from God. Which would make this spirit not of God.