Latest Tutorials

Learn about the latest technologies from fellow newline community members!

  • React
  • Angular
  • Vue
  • Svelte
  • NextJS
  • Redux
  • Apollo
  • Storybook
  • D3
  • Testing Library
  • JavaScript
  • TypeScript
  • Node.js
  • Deno
  • Rust
  • Python
  • GraphQL
  • React
  • Angular
  • Vue
  • Svelte
  • NextJS
  • Redux
  • Apollo
  • Storybook
  • D3
  • Testing Library
  • JavaScript
  • TypeScript
  • Node.js
  • Deno
  • Rust
  • Python
  • GraphQL

    Advanced Jest Testing: Mocking, Spies, and More

    Unit testing forms the backbone of reliable software development, ensuring each part of your application functions as expected. However, the real challenge often lies in effectively using Mocks, Spies, and Stubs - tools that can seem bewildering but are critical for sophisticated testing strategies. In this expanded guide, we'll dive deep into the world of Mocks, Spies, and Stubs in Jest, a popular JavaScript testing framework. You'll not only understand what these tools are but also learn to master their usage in various testing scenarios. In this article, you will learn:

    I got a job offer, thanks in a big part to your teaching. They sent a test as part of the interview process, and this was a huge help to implement my own Node server.

    This has been a really good investment!

    Advance your career with newline Pro.

    Only $40 per month for unlimited access to over 60+ books, guides and courses!

    Learn More

      How To Mock HTTP Requests with Jest: A Step-By-Step Guide

      When testing web applications, there’s always a part where you have to test your Controllers. Be it a request to your own server or an 3rd party API, one thing’s for certain: You’ll have to test a function that contains an HTTP request. And after reading this blog post, you’ll know exactly how to do that using the Jest testing framework. Jest stands out as a testing framework for several reasons:

        Common Mocking & Testing Mistakes That Ruin Your Test Cases

        Testing is all the rage right now. With Test-Driven Development being so popular, unit tests have become the new hot thing. That being said, automated testing isn't just a trend, it's a fundamental practice in software engineering for ensuring quality. Techniques like Test-Driven Development (TDD) highlight the importance of unit tests, which have become a cornerstone of modern software development. But did you know there are a lot of hidden testing mistakes a lot of us make? Some have to do with the test cases themselves. Some have to do with our mocking implementations.

          Unit Testing and Mocking Mistakes That Produce Headaches

          Testing. We all know it’s a critical part of our job, right? But let’s face it, it can be tricky. Whether you're just starting out or have been at it for years, there's always a chance you might slip up in unit testing and mocking. But don't worry, I've got you covered. In this post, we'll explore some common mistakes and how to steer clear of them.