You forgot the first part of that verse, as follows, and which clarifies in what context doubt is being used...important to consider....
Consider it pure joy, my brothers, whenever you face trials of many kinds, because you know that the testing of your faith develops perseverance. .....PERSEVERANCE MUST FINISH ITS WORK..... so that .....you may be mature and complete, not lacking anything...... If any of you lacks wisdom, he should ask God, who gives generously to all without finding fault, and it will be given him...... But when he asks, he must believe and not doubt, because he who doubts is like a wave of the sea, blown and tossed by the wind. That man should not think he will receive anything from the Lord; he is a double-minded man, unstable in all he does .....(James 1:1-8).
Perseverance is the ability to keep right on going with joy in our hearts despite apparent setbacks and disappointments, illnesses, hardships etc. and this seems to be a quality that the Lord values almost beyond all else.
There is another passage in the Bible that teaches exactly this same thing. .....in Romans 5...... Therefore, since we have been justified by faith, we have peace with God through our Lord Jesus Christ, through whom we have gained access by faith into this grace in which we now stand. And we rejoice in the hope of the glory of God.... Not only so, but we also rejoice in our sufferings, because we know that suffering produces perseverance .
Notice the same sequence Sufferings joy perseverance .
Suffering produces perseverance;.. perseverance,.. character;.. and character,.. hope... And hope does not disappoint us, because God has poured out His love into our hearts by the Holy Spirit, whom He has given us.
From our perspective, stress and strain and problems and pain are those things that mar our lives....... but from Gods perspective, those are the things that develop our faith ....and our perseverance and make us people of maturity..... James said: Perseverance must finish its work so that you may be mature and complete, not lacking anything.
PERSEVERANCE MUST FINISH ITS WORK..... so that .....you may be mature and complete, not lacking anything.
Immaturity = thin skinned.