shlogg · Early preview
Jetthoughts Dev @jetthoughts

Speed Up Jest Snapshot Testing With Linguist Configuration

Speed up PR's review of React app with Jest snapshot testing! Use .gitattributes to ignore large component files & suppress generated ones for faster language stats & diffs.

Would you like to speed up PR’s review of React application, when you use Jest snapshot testing?

How much time do we spend on waiting while snap files being rendered? Working with lots of large React components’ .snap files, manually collapsing files over and over gets quite painful. But don’t panic, here is the solution: GitHub uses Linguist to compute stats about your files, ignore files that are vendored, and even to suppress files that are generated automatically. So, you can configure it to treat files of your choosing in a certain way.

In the root of the repository create a .gitattribu...