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

Deploy React Application on Heroku Cloud Application Platform

Better Twilio Transcriptions with the Google Web Speech API

React.Children.map && React.cloneElement

ERROR Error: Uncaught (in promise): TypeError: this.dli is undefined

Typecasting and Coercion in JavaScript

3 Reasons to Avoid Using ImmutableJS With Redux

ClojureScript Integer to String Conversion

Visually Mapping out 3D with Three.js

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

Special Concepts about JavaScript & MongoDB

Intro to Javascript Event KeyCodes

Use normalize() to duel with non-English string in javascript

Learn how to build resilient JavaScript code by using TypeScript Narrowing