Coding task · JavaScript and TypeScript course · Module 9: Design Patterns and Architecture

Exercise: Testing Framework

Write unit tests for the key methods of the ParkCore, DinosaurRegistry and SecuritySystem classes.

Task

The index.js file has three unit tests: functions that receive the class to check and should return true for a correct class and false for a class with a bug. Fill in the blanks: ___BLANK1___ is the comparison operator that checks that getModule returns the same object that was registered, ___BLANK2___ is the comparison operator that checks that two ids are different, and ___BLANK3___ is the number of alerts we expect when only one of two sensors exceeds its threshold. The checker runs your tests on correct ParkCore, DinosaurRegistry and SecuritySystem classes and on versions with bugs (a copy of the module instead of the original, one id for everybody, an alarm at a reading equal to the threshold).