Created
March 29, 2017 19:42
-
-
Save mmeigooni/d040d8becc10e9e4088d9e0316cf7fb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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