Skip to content

Commit f9d0034

Browse files
improve test descriptions with conditions
1 parent b418384 commit f9d0034

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sprint-3/2-practice-tdd/repeat-str.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ const repeatStr = require("./repeat-str");
99
// When the repeatStr function is called with these inputs,
1010
// Then it should return a string that contains the original `str` repeated `count` times.
1111

12-
test("should repeat the string count times", () => {
12+
test("should repeat the string count times when count is greater than 1", () => {
1313
const str = "hello";
1414
const count = 3;
1515
expect(repeatStr(str, count)).toEqual("hellohellohello");
1616
});
17-
test(" should return original 'str' without repetition", () => {
17+
test(" should return original string when count is 1", () => {
1818
const str = "hello";
1919
const count = 1;
2020
expect(repeatStr(str, count)).toEqual("hello");
2121
});
22-
test("should return empty string", () => {
22+
test("should return empty string when count is 0", () => {
2323
const str = "hello";
2424
const count = 0;
2525
expect(repeatStr(str, count)).toEqual("");

0 commit comments

Comments
 (0)