question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - Incorrect Boilerplate in American-British Translator

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
naomi-lgbtcommented, Oct 17, 2020

This will be closed when freeCodeCamp/demo-projects#23 lands. 🙂

1reaction
naomi-lgbtcommented, Oct 8, 2020

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 erroneous convertHandler route. I’ll grab @SaintPeter next time we’re free to get that route removed. 😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

American British Translator - The freeCodeCamp Forum
I've tried writing different versions handling empty text error and all of them fail. Guess it's fcc issue… I've passed all previous tasks ......
Read more >
American British Translator - Quality Assurance Projects
This is a full walkthrough for the American - British Translator project on freeCodeCamp. Firstly, we compile the data from the various data ......
Read more >
American British Translator | FreeCodeCamp - YouTube
I go through how to do the American British Translator project on freecodecamp. Big help from kelvinsanchez15 for some good ideas on how...
Read more >
American English to British English Converter | GoTranscript
This translation tool helps to change words and spelling from the American English version to British English. Convert. British to American translator.
Read more >
Localization Sources - Articles Tutorials | AspNet Boilerplate
XML files must be unicode (utf-8). culture="en" declares that this XML file contains English texts. For text nodes; the name attribute is used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found