Five-Project Series

Unit Testing with Typescript, Jest, and WebStorm you own this product

prerequisites
basic TypeScript • basic Jest
skills learned
use IntelliJ WebStorm to write and execute tests • derive tests from existing bugs • codify current behavior as a test • use tests to drive bug fixes • change tests so that they fail until a bug is fixed
Daniel Coleman and Max Guernsey, III
5 weeks · 5-7 hours per week average · INTERMEDIATE

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


It’s a problem almost every developer will face in their career: inheriting an essential legacy library that’s full of bugs and has no automated tests to keep it running smoothly. In this liveProject series, you’ll step into the shoes of a TypeScript developer handling just such a codebase for a stock image web application—one that will soon require significant changes to the library you maintain.

You’ll use Jest and IntelliJ WebStorm to write tests and refactor this buggy code into something that’s both usable and indefinitely maintainable. Each project focuses on a different approach or testing methodology that will be a useful addition to your testing toolbox.

These projects are designed for learning purposes and are not complete, production-ready applications or solutions.

here's what's included

Project 1 Test and Fix Bugs

You’re a TypeScript developer for a large company that sells stock photography products to the general public, as well as to news and other media markets. Your task is to find and fix some long-term bugs in a legacy library. You’ll write a test to characterize a bug in code that controls how certain assets are selected for a special display. After you’ve determined the source of the problem, you’ll modify the test, transforming it into a bug fix. Once you’ve squashed that bug, you’ll repeat the process to tackle two additional common bugs in TypeScript applications.

Project 2 Legacy Code

Your company sells stock photography products to the general public, as well as to news and other media markets. As the resident TypeScript developer, you’ve been tasked with maintaining and extending a class library for optimizing search results. You’ll set up tests to support refactoring of this legacy library, use “pinning tests” to extract a specification from the existing code, and generate a wide range of test coverage. You’ll learn to spot when and where to improve code maintainability, and set up mutation testing to ensure your tests catch unintended changes. By the end, you’ll have generated test coverage that supports refactoring, making future updates easy and painless.

Project 3 Refactor

The company you work for wants to improve its system by adding functionality that maximizes the profitability of any given search. As the resident TypeScript developer, your task is to apply a battery of tests to support changing the design of legacy code in preparation for adding this new functionality. You’ll refactor your production code based on advice from your architecture team. Thanks to a broad test suite, you’ll be able to change your design with no worries about accidentally breaking a required behavior. The result will be a system you can test with smaller, more meaningful tests and that easily withstands future requirement changes.

Project 4 Requirements-Based Testing

You're a TypeScript developer at an organization that sells stock photography products to the general public, as well as to news and other media markets. The company wants to add functionality to its system that maximizes the profitability of any given search. It’s up to you to improve the test suite by adding high-quality requirements-based tests. You’ll use mocks to isolate requirements, ensuring that each test focuses on a single behavior in your code. When you’re done, you’ll have a more resilient codebase.

Project 5 The Test-First Technique

As a TypeScript developer, you’ve recently created a high-quality test suite as part of your company’s goal of adding functionality to its system. Now, using test-driven development (TDD) techniques, it’s time to analyze new requirements, reconcile them with what is currently documented by your test suite, and use the test-first technique to ensure changes to your library are justified, specified, and protected by tests.

book resources

When you start each of the projects in this series, you'll get full access to the following book for 90 days.

choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • Unit Testing with Typescript, Jest, and WebStorm project for free

project authors

Daniel Coleman

Daniel Coleman has been writing software since he was twelve years old, and has been getting paid for it for the last ten years. He quickly progressed from individual contributor to trailblazer for software design excellence, turning his teammates into fellow disciples of high quality. Dan has also worked as an embedded coach for teams, helping them perfect their craft through best practices for code design, test-driven development, behavior-driven development, and effective requirements management. He shares his thoughts on the industry and software design at agiledesign.io.

Max Guernsey, III

Max Guernsey has over twenty years of experience in software development and is currently a managing member at DevCraft LLC. He has worked on a wide range of products and technologies, including C++ class libraries, financial analysis applications, C# and Java backends, and even multi-platform video games. He is an experienced consultant and his "coaching from the keyboard" approach provides hands-on experience to learners in all aspects of modern software development.

Prerequisites

These liveProjects are for TypeScript developers who want to improve their testing skills. To begin these liveProjects you’ll need to be familiar with the following:

TOOLS
  • IntelliJ WebStorm
  • Basic TypeScript
  • Basic Jest
  • Stryker
TECHNIQUES
  • Unit testing
  • Mutation testing
  • Test-driven development (TDD)

you will learn

In this liveProject series, you’ll learn to improve your testing skills using TypeScript, Jest, and WebStorm:

  • Use IntelliJ WebStorm to write and execute tests
  • Derive tests from existing bugs by codifying current behavior
  • Use tests to drive bug fixes
  • Derive tests from existing code using the pinning technique
  • Add test coverage on an as-needed basis
  • Use mutation testing results to guide test efforts using Stryker
  • Change the design of existing code with the support of tests
  • Change test suites to take advantage of better designs
  • Use test-driven development (TDD) to build new functionality
  • Use TDD to change existing functionality
  • Write granular tests for individual requirements
  • Use larger-grain tests to drive the integration of individual components

features

Self-paced
You choose the schedule and decide how much time to invest as you build your project.
Project roadmap
Each project is divided into several achievable steps.
Get Help
While within the liveProject platform, get help from other participants and our expert mentors.
Compare with others
For each step, compare your deliverable to the solutions by the author and other participants.
book resources
Get full access to select books for 90 days. Permanent access to excerpts from Manning products are also included, as well as references to other resources.