add(num) {
const sum = this.value + num;
if (sum > 100) {
throw new Error('Value can not be greater than 100');
}
this.value = sum;
}
it('add should throw an error if value is greater than 100', () => {
expect(() => {
cal.add(101);
}).toThrow('Value can not be greater than 100');
});