export function compute(number) {
if (number < 0) {
return 0;
}
return number + 1;
}
import { compute } from './compute';
describe('compute', () => {
it( 'should return 0 if input is negative', () => {
const result = compute(-1);
expect(result).toBe(0);
});
it( 'should increment by one the number if input is positive', () => {
const result = compute(1);
expect(result).toBe(2);
});
});