Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. describe("sum(arr) - sum array of numbers", function() {
  2. it("should return 3 for [1, 2]", function() {
  3. expect(sum([1, 2])).to.be.equal(3);
  4. });
  5. it("should return 1 for [1]", function() {
  6. expect(sum([1])).to.be.equal(1);
  7. });
  8. it("should return 0 for []", function() {
  9. expect(sum([])).to.be.equal(0);
  10. });
  11. it("should return 3 for [1.5, 2.5, -1]", function() {
  12. expect(sum([1.5, 2.5, -1])).to.be.equal(3);
  13. });
  14. it("should return NaN for invalid data", function() {
  15. expect(sum("invalid data")).to.be.equal(NaN);
  16. });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement