@@ -8,13 +8,6 @@ test('shortIntroduction function exists', () => {
8
8
expect ( typeof shortIntroduction ) . toBe ( 'function' ) ;
9
9
} ) ;
10
10
11
- test ( 'shortIntroduction function requires 3 arguments' , ( ) => {
12
- const file = fs . readFileSync ( path . resolve ( __dirname , './app.js' ) , 'utf8' ) ;
13
- const shortIntroductionRegex = / f u n c t i o n \s * s h o r t I n t r o d u c t i o n \s * \( \s * \w + \s * , \s * \w + \s * , \s * \w + \s * \) \s * { / gm;
14
- const hasProperParameters = shortIntroductionRegex . test ( file . toString ( ) ) ;
15
- expect ( hasProperParameters ) . toBeTruthy ( ) ;
16
- } ) ;
17
-
18
11
test ( "shortIntroduction function returns correct introduction" , ( ) => {
19
12
20
13
const file = rewire ( "./app.js" ) ;
@@ -25,13 +18,3 @@ test("shortIntroduction function returns correct introduction", ()=>{
25
18
expect ( shortIntroduction ( "Tom" , "lead developer" , 28 ) ) . toBe ( "Hello! my name is Tom, my profession is lead developer. I am 28 years old." ) ;
26
19
expect ( shortIntroduction ( "Alberto" , "CIO" , 32 ) ) . toBe ( "Hello! my name is Alberto, my profession is CIO. I am 32 years old." ) ;
27
20
} ) ;
28
-
29
- test ( "console.log should be called with shortIntroduction function" , ( ) => {
30
- const file = fs . readFileSync ( path . resolve ( __dirname , './app.js' ) , 'utf8' ) ;
31
-
32
- // Regular expression to match console.log with the function inside
33
- let regex = / c o n s o l e \s * \. l o g \s * \( \s * s h o r t I n t r o d u c t i o n \s * / gm;
34
-
35
- // Ensure that the regular expression matches at least once
36
- expect ( regex . test ( file . toString ( ) ) ) . toBeTruthy ( ) ;
37
- } ) ;
0 commit comments