The include() and notInclude() methods are really useful. They can be used to check if an array contains a particular element, or to query an object. The first argument is the item we are looking in, and the second argument is the value we are looking for.
Link to Challenge : https://www.freecodecamp.org/learn/qu...
Written Guide: https://www.notion.so/ganeshh123/Test...
Full Playlist for this course : • Quality Assurance and Testing with Ch...
All Writen Guides for this course : https://www.notion.so/ganeshh123/54ec...
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganes...
0:00 - Concepts:
0:07 - assert.include()
Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array, a substring in a string, or a subset of properties in an object. Strict equality (===) is used. When asserting the inclusion of a value in an array, the array is searched for an element that’s strictly equal to the given value. When asserting a subset of properties in an object, the object is searched for the given property keys, checking that each one is present and strictly equal to the given property value.
https://www.chaijs.com/api/assert/#me...
02:14 - assert.notInclude()
Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array, a substring in a string, or a subset of properties in an object. Strict equality (===) is used. When asserting the absence of a value in an array, the array is searched to confirm the absence of an element that’s strictly equal to the given value. When asserting a subset of properties in an object, the object is searched to confirm that at least one of the given property keys is either not present or not strictly equal to the given property value.
https://www.chaijs.com/api/assert/#me...
03:35 - 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!
Смотрите видео 12 - Test if an Array Contains an Item - Quality Assurance with Chai - freeCodeCamp Tutorial онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Ganesh H 25 Июль 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 968 раз и оно понравилось 9 людям.