I have some class like this
export class Helper {
static unsubscribeSubscriptions(subscriptions: Subscription[]): void {
subscriptions.forEach(subscription => {
if (subscription) {
subscription.unsubscribe();
}
});
}
static isNullOrEmpty(value: string): boolean {
return (!value || value === undefined || value === '' || value.length === 0);
}
}
I have test one method, but on Subscription i don't even know how to start, this is what I have for now
describe('Helper', () => {
it('isNullOrEmpty should return true', () => {
// WHEN
const value = '';
const res = Helper.isNullOrEmpty(value);
// /THEN
expect(res).toBeTruthy();
});
it('isNullOrEmpty should return true', () => {
// WHEN
const value = 'FULL';
const res = Helper.isNullOrEmpty(value);
// /THEN
expect(res).toBeFalsy();
});
});
Does anyone know how to test unsubscribeSubscriptions