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

Grunt command line = 0 specs, 0 failures vs. Browser = Passing 1 spec #24

Open
is-already-taken opened this issue Jan 20, 2013 · 5 comments

Comments

@is-already-taken
Copy link

I've found #14, it seems to be the same error.

When running my spec on the command line via Grunt it returns with:

Testing jasmine specs via phantom
0 specs, 0 failures in 0.004s.

Done, without errors.

I ran the _SpecRunner.html in my browser, it didn't find the files due to the leading slash.
I've patched the resulting _SpecRunner.html to reference files relative (remove leading slash) manually and ran the test again. It worked fine: I had to click away some alerts, finally that page rendered:

Passing 1 spec

Test
  Test

So, I don't think my config or directory layout is bad.

I've tried patching the jasmine.js as suggested in #14, but it didn't help Grunt and PhantomJs making Jasmine work.

grunt.js Jasmine config:

...
jasmine: {
     src: "chrome/content/**/*.js",
     specs: "specs/**/*_spec.js",
     amd: true,
     helpers: [
         "node_modules/requirejs/require.js",
         "specs/mocks/*.js",
         "specs/requirejs-config.js"
     ],
     timeout: 1000,
     phantomjs: {
         "ignore-ssl-errors": true
     }
}
...

Directory-Layout (some files skipped):

|-- chrome
|   |-- content
|   |   |-- [...].js
|-- grunt.js
|-- _SpecRunner.html
`-- specs
    |-- firecompass_spec.js
    |-- mocks
    |   |-- [...].js
    `-- requirejs-config.js

Running grunt -v jasmine does not print more errors.

Environment:

  • Node 0.6.18 (I might consider updating to 0.8.16 if promisingly)
  • Grunt 0.3.15
  • grunt-contrib-jasmine 0.6
  • PhantomJS 1.6.0
  • Linux
@ssmithstone
Copy link

I'm getting the same results using node 0.8.18 i'm wondering if its because the AMD modules are not being loaded as moving away from them AMD works fine

@jsoverson
Copy link
Contributor

Have you tried running grunt with the debug option for more output, grunt -vd

Also, note that this task will be deprecated in favor of grunt-contrib-jasmine as soon as grunt 0.4.0 is released. Many updates and fixes have been made in that task.

@is-already-taken
Copy link
Author

Of course, I've used those options. But they didn't really show much more output.

I've found the grunt-contrib-jasmine plugin too. It's a pity that you didn't added a discalimer to this readme.md that your plugin will be subsituted by grunt-contrib-jasmine.

I recently moved to that plugin and it's working well even if it has some design characteristics I dont' like.
(It took me five times longer to get it working, your plugin was better documented :)

@jsoverson
Copy link
Contributor

Sorry about that, I expected grunt 0.4.0 to be released months ago and the transition to be smoother. The tasks are very similar, what were the configuration problems? I imagine they mostly arose from figuring out which options needed to be in the options hash?

@is-already-taken
Copy link
Author

I imagine they mostly arose from figuring out which options needed to be in the options hash?

Exactly. Figuring out the correct configuration options was one thing. 😁 It's only a matter of some edits in the Wiki and readme.md. I could make them another time.

Another issue is that the new module requires "phantomjs" which contains a binary. In my opinion it should be optional to use PhantomJs as Node module or pre-installed.

Thank you for your response.

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

3 participants