Tell us what’s happening:
I’ve written the functional test for the metric-imperial converter, but it seems that it is not what fcc wants, and I am not entirely sure what the expectations of the test are. Do they need a specific name.
Here is my first test as an example:
suite('Functional Tests', function() {
test('Convert a valid input such as 10L: GET request to /api/convert', done => {
chai
.request(server)
.get('/api/convert')
.query({input: '10L'})
.end((err, res) => {
assert.equal(res.body.initNum, 10);
assert.equal(res.body.initUnit, 'L');
assert.equal(res.body.returnNum, 2.64172);
assert.equal(res.body.returnUnit, 'gal');
assert.equal(res.body.string, '10 liters converts to 2.64172 gallons');
done();
});
});
}
Your project link(s)
solution: https://replit.com/@caryaharper/boilerplate-project-metricimpconverter
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Challenge: Metric-Imperial Converter
Link to the challenge: