TDD Feature-Level Tests
Lesson 1 of 1
  1. 1
    Often the hardest part of creating a full-stack web application is knowing where to start. In this lesson, we will use an outside-in development process . With this approach, we start to build our…
  2. 2
    To write the most effective feature tests, we are going to employ a few additional tools. These tools are meant to support JavaScript testing. We will cover their uses in the scope of building a fe…
  3. 3
    Feature tests exercise behavior by simulating a user navigating the application in a web browser. Imagine we wanted to create a simple web-based poetry writing application. The first feature test…
  4. 4
    The last thing our test needs is an assert statement to verify that the behavior we expect is equal to the actual behavior of our code. We want to make sure our app is in an empty state. We ca…
  5. 5
    Now that we have written our first test with an assert statement, we will run the test and use the error message to drive the next step in our development process. When executing a feature test th…
  6. 6
    Now that we are in the green we should take a moment to consider refactoring our code. Our code is pretty basic and succinct. We won’t refactor it but will take a moment to consider our current …
  7. 7
    The next step for our poetry web app is to use our browser variable for the exercise phase of the test. First, we will set the URL of the browser to go to the root of our project using the .url m…
  8. 8
    Now that we have programmed the behavior we want to test in the exercise phase, we will write the verification phase of our test. We will compare the actual results of exercising the code with the …
  9. 9
    Now that we have written our second test, it is time to write the minimal implementation code to move us forward in the TDD process. Running the test suite for our poetry web app at this point wou…
  10. 10
    Congratulations! You’ve built tests for a feature. You will notice a couple changes to your files and the addition of a web browser. First, let’s take a look at your index.html file. You will …

What you'll create

Portfolio projects that showcase your new skills

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory