Metric-Imperial Converter: unclear requirements

I am facing the “Metric-Imperial Converter” challenge. All the Chai tests pass, but the system test gives me the following error:

* If the unit of measurement is invalid, returned
will be 'invalid unit'.

* If the number is invalid, returned will be
'invalid number'.

* If both the unit and number are invalid, returned
will be 'invalid number and unit'.

What does “returned will be ‘invalid unit’” mean? Does it have to be the return value of some function? Should this be the value returned to the client by a res.send() statement? Does it have to be inside a JSON object or a simple string?

Try using res.send() to respond with that string value and see what happens. Failing the tests to validate the requirements is a valid approach.

I’m not talking of a bug, but of requirements.

What’s the point of writing code without knowing what the requirements are? Should I write an application or guess which application is the problem?

I agree with you that the requirements are vague, but the questions you had could be verified by trying before coming to the forum to ask. Do you have a link to the exercise?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.