Skip to content

Commit c8af420

Browse files
committedOct 25, 2019
--fix : code coverage 100%
1 parent cf5637e commit c8af420

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎src/_DataStructures_/Stack/postfix-expression-evaluation/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function evaluatePostfixExpression(expression) {
4343
s.push(val2 / val1);
4444
break;
4545
default:
46-
break;
46+
throw new Error('Operation is not valid');
4747
}
4848
}
4949
}

‎src/_DataStructures_/Stack/postfix-expression-evaluation/postfix-expression-evaluation.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,8 @@ describe('Postfix expression evaluation', () => {
5858
test.each(invalidExpressions)('running for %p', (expression) => {
5959
expect(() => evaluatePostfixExpression(expression)).toThrow(ERROR_STRING);
6060
});
61+
62+
expect(() => evaluatePostfixExpression('1&2')).toThrow('Operation is not valid');
63+
6164
});
6265
});

0 commit comments

Comments
 (0)
Please sign in to comment.