Tell us what’s happening:
CDN Link to test in any environment no working
I am building my projects on my local machine instead of Codepen, then paste the provided code to run the test. The thing is it doesn’t work. Sometimes the testing button will appear, but only once, then doesn’t reappear. Or it doesn’t appear at all. I have tested this with several browsers, and different platforms, and uploading the project to a testing server. I even saved the javascript as a local file and linked it, and still nothing.
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:85.0) Gecko/20100101 Firefox/85.0.
Will you please post a snippet of your code to show how you’re implementing the test suite.
When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
The code I am referring to is at the bottom of each project as quoted " CDN link to run the tests in any environment you like: https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"
I usually just open the blank Codepen and copy the script at the top of the HTML part of the CP and drop it into my local text editor, the code is:
Ahhhhh ok I have been placing it in my head element. That’s probably the issue. I will try moving it down before the closing body tag. Will test it out tomorrow, had enough coding for today!
I was just about to edit when I saw you responding so I waited.
The test script (as I said, it JavaScript) relies on the HTML code being loaded before it runs. So if it’s in the head element then it doesn’t see the HTML and that’s why it fails.
I am getting the impression the testing script might have a error. When I copy all the HTML and CSS and paste it into a Code PEN, it passes all the tests. But locally it will not pass the media query.
Glad we are on the same page. Curious what I should do moving forward, I don’t mind pasting the code in CodePen for simpler projects. But if this ends up being the only error can I move forward and still submit my link with this one issue?