File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ test("should repeat the string count times", () => {
1616 expect ( repeatedStr ) . toEqual ( "hellohellohellohello" ) ;
1717} ) ;
1818
19- / c o n s t r e p e a t = r e q u i r e ( " ./ repeat ");
19+ const repeat = require ( "./repeat" ) ;
2020
2121// case: Handle Count of 1 :
2222// Given a target string str and a count equal to 1,
@@ -77,9 +77,8 @@ test("should return an empty string when str is empty", () => {
7777// case: Undefined or missing arguments :
7878// When arguments are missing or undefined, it should throw an error.
7979test ( "should handle undefined inputs gracefully" , ( ) => {
80- expect ( ( ) => repeat ( undefined , 3 ) ) . toThrow ( ) ;
81- expect ( ( ) => repeat ( "hello" ) ) . toThrow ( ) ;
82- expect ( ( ) => repeat ( ) ) . toThrow ( ) ;
80+ expect ( ( ) => repeat ( undefined , 3 ) ) . toThrow ( "argument must be defined" ) ;
81+
8382} ) ;
8483
8584// case: Boolean inputs :
You can’t perform that action at this time.
0 commit comments