Nerd For Tech
Published in

Nerd For Tech

Matt’s Tidbits #97 — Running/Debugging individual Jest unit tests

Last week I wrote about React Fragments. This week, I have a quick tidbit about running tests in VS Code.

I hope you all had a restful long weekend! I’ve written about the importance of vacation before, and in this pandemic that just seems to keep on going (although hopefully we’re starting to see the end), it’s more important now than ever to prioritize your health and take care of yourself!

As you may have noticed, since I’ve been writing about it a bunch recently, my current project is using React Native. We’re using Jest for our unit tests, and it’s a pretty decent tool. However, it caught me slightly by surprise that the only way (that I knew of) to run our tests was via a command that ran them all at once. This became especially troublesome when I had to debug a failing unit test (perhaps I’ll write about that next time), and was trying to find a way to shorten my write/test cycle.

Thankfully, one of my coworkers pointed me at a VERY helpful VS Code extension: https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner

This extension provides links next to each unit test to let you run or debug them individually! If you’re using Jest & VS Code, you really MUST download this extension — I guarantee you it will come in handy!

What are your favorite VS Code extensions? Let me know in the comments below!

Interested in working with me in the awesome Digital Products team here at Accenture? We’re hiring!

--

--

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store