I've been working on writing a unit test with jasmine, but I've run into an issue when trying to test a local variable using jasmine. I have successfully tested a global variable in the past, but testing a local variable seems to be more challenging.
Here is the function I am currently working with:
checkDayIsOpen(): void {
let isSpecial = false;
this.items.forEach((item) => {
if (item.is_open) {
isSpecial = true;
}
});
if(isSpeciality){
// Call another function here...
}
}
My main concern now is how to effectively test the value of isSpecial
.