Hey so I have this method in my Angular app which I want to unit test:
public methodEquip(someBonus: Parameters) {
let flag = false;
for (const shield of someBonus.items) {
if (shield.added.length !== 0 || shield.removed.length !== 0) {
flag = true
}
if (flag) {
return true;
} else {
return false;
}
}
}
I want to unit test it with Jasmine. I can do simple unit tests but it's too much for me now, I'm stucked. I'm quite new to unit tests and I don't know how to do it :/ Can you help me?
I have only this for now, and I don't know how to do the rest of it:
it('tests methodEquip', () => {
let flag = false;
const newMocked = new Parameters;
component.methodEquip(newMocked);
});