- [Instructor] Now that we know what and where to Unit Test,…let's actually write some tests.…Switch over to Atom.…Right Click on the Tree View and Select New File.…From the Name, we're going to Mirror the File…that we're going to be testing,…which is test/unit/lib/schema/reservation.js.…Press Return when complete.…We're going to start by Including the Chai Assertion Library…and Initializing the Should Interface.…To do that we'll just type…const chai = require('chai').…
Then a new line…const should = chai.should() to initialize.…Then we're going to Include the Reservation Schema,…const Reservation = require,…and then up two, three, four directories,…and then lib/schema/reservation').…Add a new line.…Let's describe the test suite for the reservation…schema using the Describe Method.…
I'm going to use a full function,…rather than lambda.…Arrow functions in Moka are discouraged,…because they break Moka's integration…with the lexical binding of this.…So full function.…We're going to nest the context,…and describe a suite of tests for…
- What is code quality?
- Testing and code quality fundamentals
- Coding conventions and standards
- Creating and enforcing coding standards
- Unit, integration, and functional testing
- Test-driven development test specificatons
- Behavior-driven development test specifications
- Finding errors with linting
- Extending an ESLint shareable config
- Validating correctness with unit testing
- Replacing and inspecting with stubs, spies, and mocks
- Code coverage and why it matters
- Coverage with continuous integration
Skill Level Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
Node.js: Extend and Maintain Applicationswith Daniel Khan3h 35m Intermediate
1. Testing and Code Quality Fundamentals
2. Finding Errors with Linting
3. Validating Correctness with Unit Testing
4. Replacing and Inspecting with Stubs, Spies, and Mocks
5. Reporting on Your Entire Codebase
Where to go from here?3m 46s
- 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.