Skip to content

Commit e48395f

Browse files
committed
fixed undefined var
1 parent 9477391 commit e48395f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

__tests__/main.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@
22

33
const main = require('../main');
44

5+
test('addNumbers function adds two numbers correctly', () => {
6+
expect(main.addNumbers(2, 3)).toBe(5);
7+
});
8+
9+
test('subtractNumbers function subtracts two numbers correctly', () => {
10+
expect(main.subtractNumbers(5, 2)).toBe(3);
11+
});
512

613
// Add more tests for other functions if needed

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const unusedVariable = 'This variable is not used';
2020
const missingSemicolon = 'This line is missing a semicolon';
2121

2222
// Error: Using an undefined variable
23-
console.log(undefinedVariable);
23+
//console.log(undefinedVariable);
2424

2525
// Error: Trying to reassign a constant
2626
const constantValue = 42;

0 commit comments

Comments
 (0)