For faith to be established, it must be tested.
Faith is tested by temptation so that we may come to know its nature and its greatness–either in others, as an example and testimony of faith; or in the person who is tempted, as a comfort in his labor, a foundation for his hope and eagerness in perseverance. For, before temptation, one’s faith is not even known to oneself. That is why it is written in the Book of Wisdom, If someone has not been tempted, what do they know? And a little further on: Someone who is not experienced, knows little.
God, however, does not permit us to be tempted beyond our capacity and he, therefore, arranges for temptation to have a certain outcome so that we can sustain it. And the outcome of temptation has manifold advantages. For when, in tribulation, the testimony of faith is restored by the constancy of virtue, our neighbor is edified; but in us the merit of faith is increased, our confidence in our progress is more powerfully strengthened, charity is more ardently inflamed, the name of God is more splendidly honored and his mercy, more gloriously magnified and more wonderfully glorified.
God tests faith: not so that he, who knows all things before they come to be, may begin to know something, but so that he may make his power known in us for the augmentation of his grace and glory. Yet for all that, he is said to know when he makes us know what he deigns to reveal in us about ourselves. This is the reason for the passage: Test me, O God, and know my heart–as if to say, “By testing it, make my heart known to me.”
from Baldwin of Ford, The Commendation of Faith, Chapter 36: On Testing Faith (CF 59, pp. 128-129)