I'm writing some unit tests for our Angular application. In a few instances, we have some code that is like the following.
public submit(): void
{
if (!this.selectedValue)
{
this.error = 'some error';
return;
}
// more function things
}
Is there a way to test that the function returns when calling submit()
and there is no selectedValue
?