-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 15 Testing
In lesson 15, automated testing is introduced, using mocha, chai, and, for the GUI, puppeteer. Several kinds of tests are shown. Request testing of this application with mocha and chai is clumsy -- that combination is typically used for API tested.
It is a good idea to discuss various types of automated tests and their importance. Also, some of the tests store variables to "this", and it is important to explain the difference between arrow functions and regular functions in the handling of "this".
UPDATE for SUMMER 2024 term: When Chai updated from v4 to v5, there were some issues that came up. The lesson page (linked at the top of this page) has been updated as well as the assignment instructions Sample answers can be found here. You can use .mjs files with chai 5, but the sample solution does not do this. On the other hand, you can't do require('chai') or require('chai-http') for chai 5. Instead, the sample solution uses the import() function in ordinary .js files. It is possible to combine .js and .mjs files in the same project, but it adds complexity.