-
Notifications
You must be signed in to change notification settings - Fork 181
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
ReferenceError: Can't find variable: jasmine #28
Comments
I am having this same issue. When I run phantomjs with "--debug=yes", I get the following output: ......removed some output...... 2013-05-22T14:20:43 [DEBUG] WebPage - evaluateJavaScript result QVariant(, ) So there are a couple issues. Am I doing something wrong, or is this a bug? |
The same thing happened to me as well. |
The line: window.fs_path_separator = "\%fs_path_separator%"; yields a syntax error on windows. %fs_path_separator% is \, and so the resulting line is: window.fs_path_separator = "\"; But this is not valid JS (backslash escapes the closing quote). This should solve issue larrymyers#28 Prefixing with a backslash solves the problem on Windows, and is ignored on Mac/Unix, so everything still works there.
Hi, I also submitted a pull request with this change. |
Hi, |
It's been a while since this issue got any comments, are people still observing this problem with recent versions of PhantomJS (1.9.6+) and up-to-date jasmine-reporters? If not I would like to close the issue. If so, can someone still observing the issue provide an updated pull request? |
+1 So it would appear that there's a game of finger pointing between PhantomJS the jasmine-reporters projects? |
…ke on it when stringified. This should fix #28.
I think this is fixed on the I successfully generated JUnit xml files like so:
Please try this branch / fix and let me know if it's working for others. If so, I'll merge this into |
Hey Ben, so were you ever able to reproduce this originally? |
Yes, I was able to reproduce the issue on Win 7, and the commit I pushed fixed it for me. Is it not working for you?— On Tue, Apr 22, 2014 at 8:36 AM, karlkras [email protected]
|
Oh, I'm just getting into the office now... so I'm going to give it a go now. Just curious to know if you actually saw the problem personally. I can see by the change that this would be the logical problem. |
so with this change I need to use the new reporters too? It wouldn't do just to swap out the jasime2 phantomjs-testrunner.js ? |
This change has only been applied to the new reporters branch. The single line change could be copied over directly, but you couldn't just take |
and just wanted to make sure... this example that I'm trying to run, if phantomjs is indicated as the target browser, these are the reporters being issued: does that look right? |
If you copy that line over, then what you have might work. It is quite possible you'll need to switch your savePath to use the appropriate separator for the OS you're running the tests on, ie it might need to be Alternately, you could just check out the |
I see that jasmine.console_reporter.js is no longer in the jasmine2 branch. should I be using jasmine.terminal_reporter.js ? Okay, yeah, I'll try the test in the branch... but I am trying to avoid (for now) having to move to jasmine 2.0 |
ConsoleReporter is no longer in the TrivialReporter was also replaced with HtmlReporter in Jasmine 2. Out of curiosity, what is your reason for avoiding Jasmine 2 right now? (I've got one project with a few thousand test cases that I have been avoiding, simply because of the size of the test suite, but I recently migrated a smaller project to Jasmine 2 with very little difficulty.) |
Fear of the unknown ;) |
Have you had a chance to give the PhantomJS fix a try? From your question to the jasmine-js group it sounds like either you are having fewer troubles or you think that the health is generally improving for unspecified reasons :) If it's working for you, I'd like to port the change to the Jasmine 1 branch and close this issue. |
well, I'm working on porting my tests over to jasmine 2.0 which is having it's own set of challenges. At which point I'll confirm the fixes for the reporters. Let's just say this is pretty bad timing. |
Don't let that stop you. I can port the change to the jasmine 1 branch pretty quickly. I thought you could verify pretty quickly, I don't mean to be a road block. — On Tue, Apr 22, 2014 at 9:30 PM, karlkras [email protected]
|
Committed to both |
Okay... sorry for the false alarms... simple testing would show it working. Apparently I can't use the absolute file location (%CD%/test/testingfile.html) for the target, must be in the form file:///C:/Users/.../GitHub/vt-code-camp-2012/test/all-tests-spec.htm |
I'm glad it's working out for you. Yes, you do need to use either As you and I have both verified this now works, I'm going to close the issue. |
Okay... something completely different. I want to use require in the processing of my tests. |
In Jasmine 2, spec filter is something you set up in In Jasmine 1, there is a similar feature.
This is used like so:
As you can see, it will mark specs that don't match the filter as skipped, which should work with all reporters. I believe the specFilter support you are seeing in Give |
Okay... a bit closer... but in my case my filter looks like:
and the "Decision" is being determined by the reporter. In this case (and only as far as I can tell) the html reporter. |
|
oh I see. Okay, if I simply return true out of this then it seems to work... any hints on conditions I'd consider returning false? |
I really don't understand what you're trying to do, a better place to ask would be the jasmine-js group and provide an example. — On Fri, Apr 25, 2014 at 12:12 PM, karlkras [email protected]
|
Okay... I'll do that. One thing you might be able to address... when using the phantomjs-testrunner.js, shouldn't this kill the phantomjs process when the tests are considered complete? |
Yes it should, what is happening instead? Are you returned to your terminal session, or does the script just sit there occupying your session and you have to CTRL-C or similar to abort? |
yes... script just sit there occupying your session and you have to CTRL-C or similar to abort? |
Okay... it looks like I have to add the TrivialReporter to have this puppy work correctly.. fine now. Thanks for listening. |
Yeah, that's due to how |
Hey... once again, thanks for your support and have a great weekend. It's nice to end the week on a positive experience. |
use solution proposed in larrymyers/jasmine-reporters#28.
While trying to setup a hudson project using jasmine, phantomjs and your junit_reporter, I permanently get an error when running your example:
"ReferenceError: Can't find variable: jasmine"
Here some info about my System:
It seems that the included in junit_xml_reporter.html are not loaded (tried a console.log within the jasmine.js) but don't understand why.
I also made the relative paths (../ext) absolute. But that doesn't work either
I suppose that the bug could have to do s.t. with my environment by I don't have any clue.
Does any has an idea what could be the problem?
Here's the full stacktrace:
ReferenceError: Can't find variable: jasmine
phantomjs://webpage.evaluate():3
phantomjs://webpage.evaluate():9
phantomjs://webpage.evaluate():9
The text was updated successfully, but these errors were encountered: