02 - Test if a Variable or Function is Defined - Quality Assurance with Chai - freeCodeCamp Tutorial
Ganesh H
How I like to think of undefined : Defined - Either exists and means something or does not exist (defined to mean null or nothing) Undefined - Exists but does not mean something
We can use the assert methods isDefined() and isUndefined() to check if a given value is 'defined' or not.
Link to Challenge : https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined Written Guide: https://www.notion.so/ganeshh123/Test-if-a-Variable-or-Function-is-Defined-557d228fbda74562bc27565d0e75d172
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1SVteCORbgwlxJkAbcTiZyj All Writen Guides for this course : https://www.notion.so/ganeshh123/54ecbf7833414db885eec37f580599b4 All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
0:00 - Concepts: 0:05 - What does 'defined' mean? 0:28 - Difference between undefined and null
01:14 - assert.isDefined() Asserts that value is not undefined. https://www.chaijs.com/api/assert/#method_isdefined
03:24 - assert.isUndefined() Asserts that value is undefined. https://www.chaijs.com/api/assert/#method_isundefined
04:54 - Challenge Solution -————————————————————————————————————- Chai is an assertion library, similar to Node's built-in assert. It makes testing much easier by giving you lots of assertions you can run against your code.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
Thanks for Watching! ... https://www.youtube.com/watch?v=uA4puRt6W-M
19873800 Bytes