In this video, take a look at what it means to write a test, specifically test-driven development. Write the test first and then write the code needed to make the test pass.
- In the last lesson, we introduced the Jest … testing framework and just made a sample suite of test … In this lesson, we're going to take a look at what it means … we're going to practice something called TDD … And that's where you don't really know how to write the code … for your application just yet but you do understand … how you want it to work so you write the test first … So what we're going to do is we're going to test a function … to TDD example and I'm going to go ahead and write a test. … what I want to do but I do know I want to have a function. … And then that function needs to take in a character like P … and then a string like happy. … So there we go. … it should tell me that there are two P's within happy. … So what I'm doing when I'm testing, … The function doesn't even exist yet, … Specifically, it's telling me countLetters is not defined. … So, what we do is we come up here and we would do this … in a separate file but for brevity, I'm going to actually … add the countLetters function to this test file. …
- Making HTTP requests
- Building web and file servers
- Installing packages with npm
- Managing and linking global packages
- Working with Express, the web server framework
- Handling POST and DELETE requests
- Creating WebSockets
- Testing and debugging Node.js code
Skill Level Advanced
Node.js: Real-Time Web with Socket.IOwith Emmanuel Henri1h 24m Intermediate
Work with VSCode1m 59s
1. The HTTP Module
3. Web Servers
5. Node.js Testing
6. Automation and Deployment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.