I can't get the test suite to work in Codepen

I am starting the Responsive Web Design Projects with the first one - the Tribute Page. Using Chrome. I created a Codepen account and forked the project’s pen (https://codepen.io/freeCodeCamp/pen/MJjpwO). I have left the script unchanged ().

When I run a test the line “#mocha div missing, add it to your document” appears at the foot of the page and the button below the Run Tests button changes to “Load Tests!” and clicking on it brings the info “Run Test Suite to See Unit Tests!”

If I reload the page so it has no changes the tests run OK - they all fail of course, since there is no content but the test suite works. If I make any change at all, say adding a blank line in the HTML section, the error will happen and I can’t get the test suite to work.

This also happens if I don’t fork the pen.

I must be missing something very simple. Please help.

1 Like

Hi nemmenie, I have the same problem, unable to solve it. I hope someone can help us.

Hello nemmenie,

I have solved the problem. As the description of your problems looks like the same I had, I tell you that check the console in your browser and see if you get this error:

“Uncaught SecurityError: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document.”

If it’s your case too, the problem can be solved changing some configuration in the browser you’re using. In my case, it’s Chrome, and he has check by default this setting, in Cookies section: “Block third-party cookies”.
To solve that, you only need to go to “Allow” section bellow and click the Add button to the right, then introduce https://codepen.io/

That will make that the test suite work fine in codepen.

Good luck.

4 Likes

Hello daster

That is interesting, and I will check Chrome’s console for errors. I got it working when I found that after each edit in the Pen I need to Save it and reload the page. Then the tests work.

thanks for taking the trouble to tell me this

2 Likes

I had the exact same issue, so I followed daster’s advice, and it did the trick. Thanks for the help!

1 Like

Thank you @daster :smiley: Your advice helped me also!
In my case it wasn’t enough to allow codepen.io, I also had to allow third-party-cookies :woman_shrugging: (but I#m glad it finally worked :smiley:

1 Like

Thank you! This helped me after too much frustration. :smiley: