[BUG] - Incorrect Boilerplate in American-British Translator
See original GitHub issueDescribe your problem and how to reproduce it:
I was looking in to writing tests for the American British Translator project. Poking around the code in the example project, I see these routes in the test runner:
app.route('/_api/routes/api.js')
.get(function(req, res, next) {
console.log('requested');
fs.readFile(__dirname + '/routes/api.js', function(err, data) {
if(err) return next(err);
res.type('txt').send(data.toString());
});
});
app.route('/_api/controllers/convertHandler.js')
.get(function(req, res, next) {
console.log('requested');
fs.readFile(__dirname + '/controllers/convertHandler.js', function(err, data) {
if(err) return next(err);
res.type('txt').send(data.toString());
});
});
However, neither of these routes point to existing files. These appear to be the routes for the Metric-Imperial converter.
Is there another way to write the tests? The logic appears to be handled client-side, so I’m not sure how to approach this without modifying these routes to target the appropriate files. I tried fetching the translator.js
file directly but got hit with a CORS.
Add a Link to the page with the problem:
Example Project Code Live Example Project
Tell us about your browser and operating system:
- Browser Name: Chrome
- Browser Version: 85.0.4183.102
- Operating System: Windows 10 V1909
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
- Comments:5 (5 by maintainers)
Top GitHub Comments
This will be closed when freeCodeCamp/demo-projects#23 lands. 🙂
I’m glad you pinged me on this though.
The
api.js
file was added to the boilerplate, but we neglected to clean up the erroneousconvertHandler
route. I’ll grab @SaintPeter next time we’re free to get that route removed. 😁