Created
August 2, 2023 19:05
-
-
Save willie-hung/9d120bc0d27823baeeb9dcf8ab8c4d53 to your computer and use it in GitHub Desktop.
post_32
This file contains 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
import sum from "./sum"; | |
import { describe, expect, it } from "vitest"; | |
describe("#SUM", () => { | |
it("should return 0 for empty array", () => { | |
expect(sum()).toBe(0); | |
}); | |
it("should return 1 for [1]", () => { | |
expect(sum(1)).toBe(1); | |
}); | |
it("should return sum of all numbers", () => { | |
expect(sum(1, 2, 3, 4, 5)).toBe(15); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment