Skip to content
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

Jasmine for ExtendScript #493

Closed
madevelopers opened this issue Jan 6, 2014 · 4 comments
Closed

Jasmine for ExtendScript #493

madevelopers opened this issue Jan 6, 2014 · 4 comments

Comments

@madevelopers
Copy link

I've tried to port Jasmine for ExtendScript using the standalone zip file. I have already fixed the errors on that environment which is basically the window object changed to $.global. However I can't get the output displayed on the console. The file console.js doesn't seem to be used. Was this the one responsible for printing the results?

Also, is there already an implementation for ExtendScript?

@sheelc
Copy link
Contributor

sheelc commented Jan 6, 2014

Yes, the console.js is unused by default in the standalone runner, but is included in case users want the spec results to be printed with dots/x's/etc and failure messages to the console (which it sounds like you are looking for). One use case for why console.js might be useful is if a user wants this data sent to the browser's console and then wanted to use PhantomJS to grab all of the browser's console output and send it to the user's terminal (making for a quick command line runner for standalone Jasmine).

This is the code you would include in SpecRunner.html to wire up the console reporter:

  <script type="text/javascript" src="lib/jasmine-2.0.0/console.js"></script>
  <script type="text/javascript">
    var ConsoleReporter = jasmineRequire.ConsoleReporter();
    var reporter = new ConsoleReporter({timer: new jasmine.Timer, print: function() { console.log.apply(console, arguments); }}); // optionally pass in showColors: true
    jasmine.getEnv().addReporter(reporter);
  </script>

Hopefully that's helpful in getting output printed to the console.

I'm not aware of any implementations for ExtendScript, but perhaps some other people will chime in if there already is.

@pawelmhm
Copy link

pawelmhm commented Jan 7, 2014

Hi,

@sheelc My use case is slightly different (I'm building chrome extension), but I also need all output to console. I added the code you provided above to boot.js (removing html reporter), it works like a charm, thank you very much.

I understand that console output is not the main functionality at the moment, but is there any way, I can get all jasmine output (not just dots/errors, but also passing suite descriptions etc) in console?

@infews
Copy link
Contributor

infews commented Jan 7, 2014

The intent is for the community to be able to write their own reporters, using the two provided objects as examples. The interface is fairly basic - you should be able to test-drive your own "RichConsoleReporter" for your needs. Let us know if you need any help - any gaps you find will be useful for others.

@infews infews closed this as completed Jan 7, 2014
@tmaslen
Copy link

tmaslen commented Apr 15, 2015

I made a port of Jasmine 2.2.0 for ExtendScript. Help yourselves:

https://github.com/tmaslen/jasminejsx

/t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants