Measure code coverage with Istanbul, which monitors code execution to see if your code is being used during tests and reports the results in text, HTML, LCOV, and more.
- [Instructor] By measuring code coverage,…we can find gaps in our test cases.…What tools can we use?…There's a couple of different options…that support mocha, specifically.…There's Blanket.js, but it's no longer maintained.…There's also JSCoverage,…but that's also not currently being maintained.…I'm mentioning them to save you time…when doing a comparison.…Finally, there's Istanbul, which is…quite active and highly used.…Istanbul, from istanbul.js.org,…watches your code execution…in order to track how well your unit tests…exercise the codebase.…
This means, if the code is used,…Istanbul will keep track of it and report it.…Istanbul's command line interface is nyc.…Yes, the naming is confusing,…and it reflects the merging of two projects,…and is a subtle reference to an old…They Might Be Giants song.…Istanbul supports test frameworks…such as mocha, AVA, and others.…Istanbul also supports ES6 as long as Node does.…If you're using an older version of Node,…and you want to use ES6,…Istanbul supports Babel with a plugin.…
- 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
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.