Quality Assurance Projects - Metric-Imperial Converter Example Project accepts invalid input
See original GitHub issueDescribe your problem and how to reproduce it: I am working through the Unit and Functional tests for the Metric Imperial Converter and using the example project to verify my understanding. The example project accepts invalid inputs that are supposed to be rejected according to what is being filled out in the test suite. The specific one being tested is double fraction input. From the 2_functional-test.js file:
test('Convert 3/7.2/4kg (invalid number)', function(done) {
//done();
});
While it is not listed as a unit or functional test the example will also accept division by zero i.e. 3/0L
Add a Link to the page with the problem: https://metric-imperial-converter--freecodecamp.repl.co/
Tell us about your browser and operating system:
- Browser Name: Mozilla Firefox
- Browser Version: 80.0
- Operating System: Windows 10
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top GitHub Comments
I took a stab at this again. This is very much an “onion” problem - many layers and they all make you cry.
Here are the assumptions:
/
preceded by and succeeded by a single digit.I discovered another issue. Invalid input like a “double fraction”: https://metric-imperial-converter--freecodecamp.repl.co/api/convert?input=1//2gal
Causes a server error: