-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Problem in PhantomJS #107
Comments
Does this occur with basic, simple tests or assertions? Or can you narrow this down to some particular test? For example I can see how this would be problematic if you were relying on |
I've just tried the most minimal test without loading my app modules and libs and it seems to be working. I'm currently busy with other work but I will try adding stuff step by step and let you know when the problem arises. |
I did some testing with PhantomJs and got this same error. It looks like this occurs if you try to assign As far as I have seen this only happens with PhantomJS. Here is a sample mocha html file for use with mocha-phantomjs: <!DOCTYPE html>
<html>
<head>
<title>Browser Tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
<script src="../../node_modules/mocha/mocha.js"></script>
<script src="../../node_modules/chai/chai.js"></script>
<script src="../../build/build.js"></script>
<script>
mocha.setup('bdd')
var should = chai.should();
</script>
<script src="../test.js"></script>
<script>
onload = function () {
if (window.mochaPhantomJS) mochaPhantomJS.run()
else mocha.run();
}
</script>
</head>
<body>
<div id="mocha"></div>
</body>
</html> |
That was exactly the problem, thank you! My app (including tests) is divided to AMD modules generated by TypeScript compiler. I put only "var should;" to outer scope in "entry-point" js file and tests are running. Thank you again ;) I really appreciate your work. |
Hi, I had similar issue with
causing
for me fix was simply
|
If you need to expose it on
|
Why is this issue closed? The problem still exists. |
check #107 (comment) , which works |
Yes, but it's a work-around. The bug is still there, either in chai or phantom. |
With change delivered with fixing #86 I'm unable to use Chai in PhantomJS (1.7) getting this error in output:
When I replace new non-empty setter:
with old (empty) one:
everything works fine.
Running in regular browser is fine either way.
The text was updated successfully, but these errors were encountered: