Merge commit '8cceb8b9d955686a4a435224304a24ce2896c0c3'

Conflicts:
	package.json
This commit is contained in:
Heiko Behrens 2013-06-05 14:33:47 +02:00
commit 0fdf44b052
7 changed files with 73 additions and 22 deletions

View File

@ -1,3 +1,9 @@
v0.4.2:
date: 2013-04-03
changes:
- bumped grunt-lib-phantomjs to 0.3.0/1.9 (closes #45)
- merged #38, #51
- addressed #40, #43, #48, #45
v0.4.0: v0.4.0:
date: 2013-03-08 date: 2013-03-08
changes: changes:

View File

@ -83,6 +83,18 @@ Type: `String|Array`
*Minimatch* - CSS files that get loaded after the jasmine.css *Minimatch* - CSS files that get loaded after the jasmine.css
#### options.version
Type: `String`
Default: '1.3.1'
This is the jasmine-version which will be used. currently available versions are:
* 1.0.0
* 1.1.0
* 1.2.0
* 1.3.0
* 1.3.1
#### options.outfile #### options.outfile
Type: `String` Type: `String`
Default: `_SpecRunner.html` Default: `_SpecRunner.html`
@ -90,6 +102,12 @@ Default: `_SpecRunner.html`
The auto-generated specfile that phantomjs will use to run your tests. The auto-generated specfile that phantomjs will use to run your tests.
Automatically deleted upon normal runs Automatically deleted upon normal runs
#### options.keepRunner
Type: `Boolean`
Default: `false`
Prevents the auto-generated specfile used to run your tests from being automatically deleted.
#### options.junit.path #### options.junit.path
Type: `String` Type: `String`
Default: undefined Default: undefined
@ -185,7 +203,7 @@ grunt.initConfig({
src: 'src/**/*.js', src: 'src/**/*.js',
options: { options: {
specs: 'spec/*Spec.js', specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js' helpers: 'spec/*Helper.js',
template: 'custom.tmpl' template: 'custom.tmpl'
} }
} }
@ -218,6 +236,7 @@ for more information on the RequireJS template.
## Release History ## Release History
* 2013-04-02v0.4.2bumped grunt-lib-phantomjs to 0.3.0/1.9 (closes merged addressed
* 2013-03-07v0.4.0bumped grunt-lib-phantomjs to 0.2.0/1.8 allowed spec/vendor/helper list to return non-matching files (e.g. for remote, http) merged merged * 2013-03-07v0.4.0bumped grunt-lib-phantomjs to 0.2.0/1.8 allowed spec/vendor/helper list to return non-matching files (e.g. for remote, http) merged merged
* 2013-02-23v0.3.3Added better console output (via Gabor Kiss @Neverl) * 2013-02-23v0.3.3Added better console output (via Gabor Kiss @Neverl)
* 2013-02-16v0.3.2Ensure Gruntfile.js is included on npm. * 2013-02-16v0.3.2Ensure Gruntfile.js is included on npm.
@ -234,4 +253,4 @@ for more information on the RequireJS template.
Task submitted by [Jarrod Overson](http://jarrodoverson.com) Task submitted by [Jarrod Overson](http://jarrodoverson.com)
*This file was generated on Sun Mar 10 2013 22:14:38.* *This file was generated on Fri Apr 12 2013 19:45:58.*

View File

@ -29,7 +29,7 @@ grunt.initConfig({
src: 'src/**/*.js', src: 'src/**/*.js',
options: { options: {
specs: 'spec/*Spec.js', specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js' helpers: 'spec/*Helper.js',
template: 'custom.tmpl' template: 'custom.tmpl'
} }
} }

View File

@ -26,6 +26,18 @@ Type: `String|Array`
*Minimatch* - CSS files that get loaded after the jasmine.css *Minimatch* - CSS files that get loaded after the jasmine.css
## options.version
Type: `String`
Default: '1.3.1'
This is the jasmine-version which will be used. currently available versions are:
* 1.0.0
* 1.1.0
* 1.2.0
* 1.3.0
* 1.3.1
## options.outfile ## options.outfile
Type: `String` Type: `String`
Default: `_SpecRunner.html` Default: `_SpecRunner.html`
@ -33,6 +45,12 @@ Default: `_SpecRunner.html`
The auto-generated specfile that phantomjs will use to run your tests. The auto-generated specfile that phantomjs will use to run your tests.
Automatically deleted upon normal runs Automatically deleted upon normal runs
## options.keepRunner
Type: `Boolean`
Default: `false`
Prevents the auto-generated specfile used to run your tests from being automatically deleted.
## options.junit.path ## options.junit.path
Type: `String` Type: `String`
Default: undefined Default: undefined

View File

@ -1,7 +1,7 @@
{ {
"name": "grunt-contrib-jasmine", "name": "grunt-contrib-jasmine",
"description": "Run jasmine specs headlessly through PhantomJS.", "description": "Run jasmine specs headlessly through PhantomJS.",
"version": "0.4.1", "version": "0.4.2",
"homepage": "https://github.com/gruntjs/grunt-contrib-jasmine", "homepage": "https://github.com/gruntjs/grunt-contrib-jasmine",
"author": { "author": {
"name": "Grunt Team", "name": "Grunt Team",
@ -28,14 +28,15 @@
"test": "grunt test" "test": "grunt test"
}, },
"dependencies": { "dependencies": {
"grunt-lib-phantomjs": "git://github.com/HBehrens/grunt-lib-phantomjs.git#20f675c331893ee4b1a328ae7a1ce82d75099e50", "grunt-lib-phantomjs": "~0.3.0",
"rimraf": "~2.0.3" "rimraf": "~2.0.3"
}, },
"devDependencies": { "devDependencies": {
"grunt-contrib-internal": "~0.4.0", "grunt-contrib-internal": "~0.4.0",
"grunt-contrib-nodeunit": "~0.1.2", "grunt-contrib-nodeunit": "~0.1.2",
"grunt-contrib-jshint": "~0.2.0", "grunt-contrib-jshint": "~0.2.0",
"grunt": "~0.4.0" "grunt": "~0.4.0",
"grunt-contrib-connect": "~0.3.0"
}, },
"peerDependencies": { "peerDependencies": {
"grunt": "~0.4.0" "grunt": "~0.4.0"

View File

@ -21,15 +21,7 @@ module.exports = function(grunt) {
var junitTemplate = __dirname + '/jasmine/templates/JUnit.tmpl'; var junitTemplate = __dirname + '/jasmine/templates/JUnit.tmpl';
var status = { var status = {};
specs : 0,
failed : 0,
passed : 0,
total : 0,
skipped : 0,
duration : 0,
log : ''
};
grunt.registerMultiTask('jasmine', 'Run jasmine specs headlessly through PhantomJS.', function() { grunt.registerMultiTask('jasmine', 'Run jasmine specs headlessly through PhantomJS.', function() {
@ -69,11 +61,15 @@ module.exports = function(grunt) {
var done = this.async(); var done = this.async();
phantomRunner(options, function(err,status) { phantomRunner(options, function(err,status) {
var success = !err && status.failed === 0;
if (err) grunt.log.error(err); if (err) grunt.log.error(err);
if (status.failed === 0) grunt.log.ok('0 failures'); if (status.failed === 0) grunt.log.ok('0 failures');
else grunt.log.error(status.failed + ' failures'); else grunt.log.error(status.failed + ' failures');
options.keepRunner = options.keepRunner || !success;
teardown(options); teardown(options);
done(!err && status.failed === 0); done(success);
}); });
}); });
@ -88,6 +84,7 @@ module.exports = function(grunt) {
var file = options.outfile; var file = options.outfile;
if (options.host) { if (options.host) {
if (!(/\/$/).test(options.host)) options.host = options.host + '/';
file = options.host + options.outfile; file = options.host + options.outfile;
} }
@ -103,8 +100,8 @@ module.exports = function(grunt) {
} }
function teardown(options) { function teardown(options) {
if (fs.statSync(options.outfile).isFile()) fs.unlink(options.outfile); if (!options.keepRunner && fs.statSync(options.outfile).isFile()) fs.unlink(options.outfile);
jasmine.cleanTemp(); if (!options.keepRunner) jasmine.cleanTemp();
// Have to explicitly unregister nested wildcards. Need to file a bug for EventEmitter2 // Have to explicitly unregister nested wildcards. Need to file a bug for EventEmitter2
phantomjs.removeAllListeners('*'); phantomjs.removeAllListeners('*');
@ -116,6 +113,16 @@ module.exports = function(grunt) {
function setup(options) { function setup(options) {
var thisRun = {}; var thisRun = {};
status = {
specs : 0,
failed : 0,
passed : 0,
total : 0,
skipped : 0,
duration : 0,
log : ''
};
phantomjs.on('fail.timeout',function(){ phantomjs.on('fail.timeout',function(){
grunt.log.writeln(); grunt.log.writeln();
grunt.warn('PhantomJS timed out, possibly due to an unfinished async spec.', 90); grunt.warn('PhantomJS timed out, possibly due to an unfinished async spec.', 90);
@ -242,4 +249,4 @@ module.exports = function(grunt) {
}); });
} }
}; };

View File

@ -8,12 +8,12 @@
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css"> <link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script> <script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script> <script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
<!-- include source files here... --> <!-- include spec files here... -->
<script type="text/javascript" src="spec/SpecHelper.js"></script> <script type="text/javascript" src="spec/SpecHelper.js"></script>
<script type="text/javascript" src="spec/PlayerSpec.js"></script> <script type="text/javascript" src="spec/PlayerSpec.js"></script>
<!-- include spec files here... --> <!-- include source files here... -->
<script type="text/javascript" src="src/Player.js"></script> <script type="text/javascript" src="src/Player.js"></script>
<script type="text/javascript" src="src/Song.js"></script> <script type="text/javascript" src="src/Song.js"></script>