Skip to content

Commit 875911d

Browse files
Update test.js
1 parent 28574b1 commit 875911d

File tree

1 file changed

+0
-17
lines changed
  • exercises/10-Create_a_new_function

1 file changed

+0
-17
lines changed

exercises/10-Create_a_new_function/test.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ test('shortIntroduction function exists', () => {
88
expect(typeof shortIntroduction).toBe('function');
99
});
1010

11-
test('shortIntroduction function requires 3 arguments', () => {
12-
const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8');
13-
const shortIntroductionRegex = /function\s*shortIntroduction\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-
1811
test("shortIntroduction function returns correct introduction", ()=>{
1912

2013
const file = rewire("./app.js");
@@ -25,13 +18,3 @@ test("shortIntroduction function returns correct introduction", ()=>{
2518
expect(shortIntroduction("Tom", "lead developer", 28)).toBe("Hello! my name is Tom, my profession is lead developer. I am 28 years old.");
2619
expect(shortIntroduction("Alberto", "CIO", 32)).toBe("Hello! my name is Alberto, my profession is CIO. I am 32 years old.");
2720
});
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 = /console\s*\.log\s*\(\s*shortIntroduction\s*/gm;
34-
35-
// Ensure that the regular expression matches at least once
36-
expect(regex.test(file.toString())).toBeTruthy();
37-
});

0 commit comments

Comments
 (0)