Consider it all joy, my brethren, when you encounter various trials, knowing that the testing of your faith produces endurance. And let endurance have its perfect result, so that you may be perfect and complete, lacking in nothing. – James 1:2-4
I would tend to think of “testing of my faith” being perilously close to “struggling with doubt”.
However, the Spirit – who is sent to guide us into all the truth –
prompts me to think of it more this way: If I have no trials, how would I know that I have faith that holds steadfast under strain? I would become spiritually flaccid without any opportunity to exercise my belief in Him. As for endurance, when one first starts to exercise, he is very limited as to what he can do. After much practice, though, staying power vastly improves. “Trials” are testing experiences that are more than we have tackled before. As our physical muscles were designed to improve with increased training, so our spiritual muscles with increasing trials.