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

Headless jasmine #30

Merged
merged 2 commits into from
May 30, 2012
Merged

Headless jasmine #30

merged 2 commits into from
May 30, 2012

Conversation

mklabs
Copy link
Contributor

@mklabs mklabs commented May 30, 2012

Hi there,

I wanted to submit this start on the jasmine task integration. #9 is related.

I thought it would be better for us to have something we can play with right away, even if there's still some work to do. The grunt-jasmine-task plugin is pretty good. It was really easy to integrate (apart from grunt.loadNpmTasks we cant' use, I've added some comments to exlain in cli/tasks/h5bp.js we might remove later on).

The only caveat is that it only works on OSX right now, windows and linux are getting timeout error that are apparently not easy to find & fix (issue 4 in original repo)

We'll probably also need to add a specrunner and the jasmine environment in the init task, as well as the according grunt config, something like (borrowed from the plugin doc)

// Jasmine headless test through PhantomJS
// > https://github.com/creynders/grunt-jasmine-task
jasmine: {
  all: ['specs/SpecRunner.html']
}

I'll see if I can find something about this issue with other system than osx. I managed to reproduced the error on a CentOS box, with the default spec runner that comes with Jasmine 1.2.0.

@addyosmani
Copy link
Member

This looks like a great start. Thanks @mklabs!.

The only caveat is that it only works on OSX right now, windows and linux are getting timeout error that are apparently not easy to find & fix (issue 4 in original repo)

I was just reading through the thread in the original repo and the last comment (from someone else with the same error) suggested it was a configuration issue. Could you confirm if this isn't the case?

As with other parts of the project I think it's going to be okay if we're not solving all of the problems for windows and linux in V1. I do think it might be useful for us to separately create them as issue in the tracker though so that we can keep an eye on what they are and deal with them in V2.

Merging this now!.

addyosmani added a commit that referenced this pull request May 30, 2012
@addyosmani addyosmani merged commit a6b441c into yeoman:master May 30, 2012
@mklabs
Copy link
Contributor Author

mklabs commented May 30, 2012

I'm currently trying to debug it through my CentOS box. I'll test to add this spec reporter configuration...

Edit: Oh my... that was it Addy.

The default Jasmine configuration is like this:

<script type="text/javascript">
  jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
  jasmine.getEnv().execute();
</script>

Changed to just

<script type="text/javascript">
  jasmine.getEnv().execute();
</script>

And it worked... Thanks!!!

$ yeoman jasmine
Running "jasmine:all" (jasmine) task
Running specs for SpecRunner.html
.....
>> 8 assertions passed in 5 specs (6ms)
Done, without errors.

Failing specs:

$ yeoman jasmine
Running "jasmine:all" (jasmine) task
Running specs for SpecRunner.html
.F...
<WARN> 1/8 assertions failed in 5 specs (6ms) Use --force to continue. </WARN>
Aborted due to warnings.

Good news!

This makes me think we should really add the according Jasmine runner, ready to be use to avoid this kind of mistakes.

If you feel that we should, could you create the ticket and assign it to me? I can handle the init task integration, but you may want to play with it first a little bit, and setup the Jasmine runner you'd like.

@addyosmani
Copy link
Member

No worries! I've just created an issue linked to this so you can work on it when you get a chance :)

addyosmani added a commit that referenced this pull request Apr 24, 2015
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

Successfully merging this pull request may close these issues.

2 participants