My functions in Calculator
class is private and I can't test in this way,
describe('calculate', function() {
it('add', function() {
let result = Calculator.Sum(5, 2);
expect(result).toBe(7);
});
it('substract', function() {
let result = Calculator.Difference(5, 2);
expect(result).toBe(3);
});
});
how can I modify this test with using spyOn
on private methods?
thanks for any help
Aucun commentaire:
Enregistrer un commentaire