jasmine-contrib / grunt-jasmine-task Goto Github PK
View Code? Open in Web Editor NEWGrunt task for running Jasmine specs
License: MIT License
Grunt task for running Jasmine specs
License: MIT License
Hi @jsoverson,
I'm going to continue the discussion here instead of the commit message
Do you think it's best I setup an organisation and transfer the repo to it?
Or shall I add you as a collaborator to this one?
Also do you have any idea how I can share the module ownership with you in npm?
Anyway, there are 2 issues that need to be dealt with:
Further, some minor things to note:
Not sure if I misunderstood the config options, but when I use two specs runners, the second one always times out with message <WARN> PhantomJS timed out, possibly due to an unfinished async spec. Running -verbose and -d didn't reveal anything other than the jasmine grunt task is trying to process the second spec runner.
I'm using PhantomJS 1.5.0 on a Mac.
jasmine: {
all: {
src:['specs/editor.runner.html', 'specs/editor.console.runner.html'],
timeout: 10000 //in milliseconds
}
}
Including all the specs within one runner solved the problem. My intention to use multiple spec runners was to setup different browser conditions.
BTW, thanks for great grunt plugin.
When I run the grunt command, Here is what I get:
Running "jasmine:index" (jasmine) task
Running specs for SpecRunner.html
PhantomJS timed out, possibly due to a missing QUnit start() call. Use --
force to continue.
Aborted due to warnings.
Do you know what this could be from?
In the project I'm working on, I use a watch
task to monitor the source files and perform a variety of tasks whenever they change. (lint
, less
, jst
, jasmine
, etc)
I know that grunt -v
makes the task show more info, but the problem is that -v
applies to all tasks being run. I'd like to minimize console spam unless something is failing.
It would be nice if grunt-jasmine would print the names of failing tests only, and stay relatively quiet otherwise, without requiring -v
.
the config file tasks/jasmine/phantom-config.json is never read.
Use this configuration:
{
"webSecurityEnabled" : false
}
and log the phantom.defaultPageSettings.webSecurityEnabled property.
quick fix: change the arguments in the call of phantomjs helper from:
args : [
// The main script file.
grunt.task.getFile( 'jasmine/phantom-jasmine-runner.js' ),
// The temporary file used for communications.
tempfile.path,
// The Jasmine helper file to be injected.
grunt.task.getFile( 'jasmine/jasmine-helper.js' ),
// URL to the Jasmine .html test file to run.
url,
timeout,
// PhantomJS options.
'--config=' + grunt.task.getFile( 'jasmine/phantom-config.json' )
]
to:
args : [
// PhantomJS options.
'--config=' + grunt.task.getFile( 'jasmine/phantom-config.json' ),
// The main script file.
grunt.task.getFile( 'jasmine/phantom-jasmine-runner.js' ),
// The temporary file used for communications.
tempfile.path,
// The Jasmine helper file to be injected.
grunt.task.getFile( 'jasmine/jasmine-helper.js' ),
// URL to the Jasmine .html test file to run.
url,
timeout
]
Moreover, it could be great to have the ability to set a config file path from the gruntfile.
I have phantomjs installed and I have added the bin dir to my path.
I can run and execute phantomjs from the command-line, however the jasmine tests cant seem to start phantom
I am really baffled by this? any suggestions?
OSX Lion
PhantomJS 1.6.1
Node v0.8.1
h5bp v0.2.2
grunt v0.3.11
Running PhantomJS...ERROR
In order for this task to work properly, PhantomJS must be installed and in
the system PATH (if you can run "phantomjs" at the command line, this task
should work). Unfortunately, PhantomJS cannot be installed automatically via
npm or grunt. See the grunt FAQ for PhantomJS installation instructions:
https://github.com/cowboy/grunt/blob/master/docs/faq.md
PhantomJS not found. Use --force to continue.
I am trying to test a requirejs application and I get timeout errors from phantomJS 1.6. Is there a problem with phantomjs and requirejs? Does grunt-jasmine-task support requirejs?
I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.
If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.
If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8"
as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0"
to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.
Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.
Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!
If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.
Thanks, we really appreciate your work!
When I try to run grunt jasmine, it failed, due to a timeout, in Ubuntu 10.04 with PhantomJS 1.5.
But the same project worked well in my Mac 10.7.3.
The error message is as follows:
Running "jasmine:all" (jasmine) task
Running specs for index.html
<WARN> PhantomJS timed out, possibly due to an unfinished async spec. Use --force to continue. </WARN>
Aborted due to warnings.
In order to debug, I replaced my project with jasmine demo from official site. The same phenomenon happened again.
Here is the minimized project to indicate problem:
http://kcz.me/test/grunt-jasmine.zip
Maybe the reason comes from phantomJS version. Is there anyone know where I can download PhantomJS 1.3 since that there is no download link in googlecode.
Thanks.
Or concoct alternative wiring.
the readme doesnt mention phantom at all, but the code certainly does
is the intent of this task to run jasmine within phantom, a browser, or both?
Thanks!
When specs fail, grunt jasmine
just outputs something like this:
$ grunt jasmine
Running "jasmine:all" (jasmine) task
Running specs for index.html
F
<WARN> 1/1 assertions failed in 1 specs (21ms) Use --force to continue. </WARN>
Aborted due to warnings.
Maybe it should output which tests fails, and perhaps a tracelog to find out why.
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.