Learn Feature Testing With TDD
Learn feature development for a full-stack web application by writing JavaScript tests that use headless browsing to simulate user interaction.
StartTDD Feature-Level Tests
Lesson 1 of 1
- 1Often 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…
- 2To 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…
- 3Feature 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…
- 4The 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…
- 5Now 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…
- 6Now 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 …
- 7The 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…
- 8Now 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 …
- 9Now 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…
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