My test cases passes in Codepen but not in my browser?

You have to serve the page locally. You can use the Live Server extension (or there is Five Server which is more maintained).

Edit: Some more information. It’s just a limitation of the tests when running locally. I’m pretty sure we used to have information about this when the project section had its own page. But it just has a block section now so it’s missing the information. At least that is how I remember it.