Skip to content

Instantly share code, notes, and snippets.

@mmeigooni
Created March 29, 2017 19:42
Show Gist options
  • Save mmeigooni/d040d8becc10e9e4088d9e0316cf7fb9 to your computer and use it in GitHub Desktop.
Save mmeigooni/d040d8becc10e9e4088d9e0316cf7fb9 to your computer and use it in GitHub Desktop.
describe("sumDigits", function() {
it("should return a number", function() {
expect(typeof sumDigits(2002)).toBe("number");
});
it("should sum the digits of a positive number", function() {
expect(sumDigits(2002)).toBe(4);
});
it("should sum the digits of a negative number", function() {
expect(sumDigits(-2004)).toBe(2);
});
it("should sum return 0 if the number is 0", function() {
expect(sumDigits(0)).toBe(0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment