You can take Font Awesome to the next level by learning a little more about the behind-the-scenes stuff that we do to load icons and fine-tuning it to exactly what you need.
When testing components, you’ll want to make sure that any icons referenced in those components are available for testing purposes. You have a couple choices here:
Could not find icon { prefix: 'fas', iconName: 'chevron-right' }
If this happens, and the icon isn’t important to the particular test, you can mock FontAwesomeIcon like this:
import React from 'react'
export function FontAwesomeIcon(props) {
return <i classname="fa"></i>
}
With create-react-app, you can put this code in src/__mocks__/@fortawesome/react-fontawesome.js to automatically include it in any tests, and alleviate errors.
Are you hungry for more knowledge? You can deep dive into our Font Awesome SVG Core and Javascript API docs.