mew-time
Version:
utils about the time.
23 lines (17 loc) • 630 B
JavaScript
import fillSpace from "utils/fill-space";
describe("utils/fill-space", () => {
it ("첫번째 인자에 string 또는 number type이 아니면 타입에러가 발생한다.", () => {
expect(() => {
fillSpace(null);
}).toThrowError(TypeError);
});
it("fillSpace(1)은 '01'이다.", () => {
expect(fillSpace(1)).toEqual("01");
});
it("fillSpace(1, 3)은 '001'이다.", () => {
expect(fillSpace(1, 3)).toEqual("001");
});
it("fillSpace('a', 4, '+', true)는 'a+++'이다.", () => {
expect(fillSpace("a", 4, "+", true)).toEqual("a+++");
});
});