-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Script error" regression #165
Comments
great, thanks |
This issue has been inactive for over 1 month so I'm closing it. If you think it's still an issue re-open. - tjbot |
This issue as described in chaijs/chai#4 still occurs and should be re-opened. |
@nilbus Can you provide a very simple spec to reproduce this? |
yes, I'll try |
I created a small repo that reproduces this problem: nilbus/script-error It basically boils down to this: describe('script-error', function() {
it('occurs in Chrome when an assertion fails in an async callback', function(done) {
setTimeout(function() {
expect(1).to.eql(2);
done();
}, 0)
});
}); My particular setup uses bdd style and chai expect. I don't expect this to be relevant, though I haven't tested other combinations. |
Browser specifics:
|
Why the Windows tag? This was tested in OSX. |
my bad, just saw TJ mention IE |
I looked into this some. I can reproduce it fine when loading your "script-error" repo via a I believe this is a security measure by Chrome/Chromium to disallow access by |
(that being said, I don't think we can do anything about it) |
Good observation. Thank you. |
Would you say that running via file:// is extremely common? Perhaps we |
@nilbus Guess that depends on the test runner. Are there any that use I do recall getting quite a few "Script Error"'s out of IE for various reasons. That may have changed in newer versions though. Other than this I've never seen Chrome throw one, so we could potentially sniff for Chrome and say "hey, don't use a |
It may be that certain extensions, when allowed access to file system resources, can cause this error in a server context (not sure). In order for this to happen, you have to explicitly give the extension the permission; I don't think extensions are allowed to even ask you. Someone should check. An example of this type of extension would be Tampermonkey. But again if you are doing stuff like that, you get what's coming to you. 😄 |
Maybe I'm alone in just opening the HTML file as my test runner? :-) |
I think it's related to Same Origin Policy. I was running my tests in Chromium version 39.0.2171.65 Ubuntu 14.04 64-bit. Everything was served from localhost (by simple express server) over HTTP, except Chai which was served from CDN. I had same symptoms. Accessing Chai via HTTP or HTTPS made no difference. Downloading it and serving from localhost server fixed the problem. |
Perhaps that applies differently to |
I'm not an expert, but it seems that sometimes browsers treat two files loaded via @nilbus It's very easy to serve local files with ad hoc server though. Check out this Big list of http static server one-liners. That might be the easiest workaround for you. |
Meaningful error messages - see mochajs/mocha#165 Test server responds to POST requests by echoing req.body and req.files.
cc @c4milo
possibly due to the new IE stuff, taking a look
The text was updated successfully, but these errors were encountered: