Unit Testing in Javascript

Photo by Karl Pawlowicz on Unsplash
  • JEST — maintained by Facebook and preferred for applications powered on React, but also compatible with NodeJS, Angular, Vue, and other Babel-based apps; fast and great for preventing UI bugs because it saves screenshots of the rendered component and compares it to later renditions of the same component
  • Mocha — one of the oldest JS unit testing frameworks, there is a lot of documentation provided online, but takes time to configure
  • Ava — performs tests asynchronously/concurrently and contains simple syntax.
  • Jasmine — compatible across every JS framework and especially beneficial for frontend testing and checking that the app is responsive and corrects depending on device. Best for larger applications that integrate with multiple external libraries.
  • Puppeteer — developed by Google and supports ES6 features like async, etc. Tests are browser-specific, so it provides a lot of support for responsive testing as well.

--

--

--

full-stack developer exploring how software can solve real-world problems | https://sarabastian.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Complex Routing with React Native Router Flux

Reacts Hooks: 5 Hooks You Need To Know

Creating complex interactions with interactive components — Button

How We Auto-Generate Documentation, JavaScript Style

react-native-help-create: A friendly tool for React Native projects

Review day 2

I’ve spent 5 years writing a JavaScript framework on my own.

Ethereum + IPFS + React DApp Tutorial Pt. 3

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
Sara Bastian

Sara Bastian

full-stack developer exploring how software can solve real-world problems | https://sarabastian.com/

More from Medium

Multiple Copy Paste for VS Code

JavaScript memory model demystified

Using async/await in a forEach loop (you can’t)

React Vs Angular: Yet Another Opinion