Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Updating for Grunt 0.4.0
Browse files Browse the repository at this point in the history
+ renaming grunt.js to Gruntfile.js
+ updating plugin for grunt 0.4.0
  • Loading branch information
nicknisi committed Mar 13, 2013
1 parent e251305 commit 0973594
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 79 deletions.
16 changes: 6 additions & 10 deletions grunt.js → Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ module.exports = function (grunt) {
dirs : ['tests'],
reporter : 'dotmatrix'
},
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'tasks/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'default'
nodeunit: {
tests: ['test/**/*.js']
},
jshint: {
options: {
Expand All @@ -40,6 +33,9 @@ module.exports = function (grunt) {
grunt.loadTasks('tasks');

// Default task.
grunt.registerTask('default', 'lint test');
grunt.registerTask('default', ['jshint', 'test']);
grunt.registerTask('test', ['nodeunit']);

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
};
85 changes: 45 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
{
"name": "grunt-it",
"description": "A grunt task for executing tests written with the it test framework",
"version": "0.2.4",
"homepage": "https://github.com/nicknisi/grunt-it",
"author": {
"name": "Nick Nisi",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/nicknisi/grunt-it.git"
},
"bugs": {
"url": "https://github.com/nicknisi/grunt-it/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/nicknisi/grunt-it/blob/master/LICENSE-MIT"
}
],
"main": "grunt.js",
"bin": "bin/grunt-it",
"engines": {
"node": "*"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "~0.3.17",
"it": "~0.2.0"
},
"keywords": [
"gruntplugin",
"unit-testing",
"test",
"tests",
"it"
]
"name": "grunt-it",
"description": "A grunt task for executing tests written with the it test framework",
"version": "0.3.0",
"homepage": "https://github.com/nicknisi/grunt-it",
"author": {
"name": "Nick Nisi",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/nicknisi/grunt-it.git"
},
"bugs": {
"url": "https://github.com/nicknisi/grunt-it/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/nicknisi/grunt-it/blob/master/LICENSE-MIT"
}
],
"main": "grunt.js",
"bin": "bin/grunt-it",
"engines": {
"node": "*"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "~0.4.0",
"it": "~0.2.0",
"grunt-contrib-jshint": "~0.2.0",
"grunt-contrib-nodeunit": "~0.1.2"
},
"peerDependencies": {
"it": "~0.2.0"
},
"keywords": [
"gruntplugin",
"unit-testing",
"test",
"tests",
"it"
]
}
33 changes: 5 additions & 28 deletions tasks/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@
* grunt-it
* https://github.com/nicknisi/grunt-it
*
* Copyright (c) 2012 Nick Nisi
* Copyright (c) 2013 Nick Nisi
* Licensed under the MIT license.
*/
module.exports = function (grunt) {

// Please see the grunt documentation for more information regarding task and
// helper creation: https://github.com/gruntjs/grunt/blob/master/docs/toc.md
"use strict";

// ==========================================================================
// TASKS
// ==========================================================================

// grunt.registerTask('it', 'Execute it tests', function () {
// var config = grunt.config.get('it'),
// dirs = config.dirs || '/',
// reporter = config.reporter || 'dotmatrix';
// grunt.log.write(grunt.helper('it'));
// });
module.exports = function (grunt) {

grunt.registerMultiTask('it', 'execute it unit tests', function () {
var it = require('it'),
Expand All @@ -38,8 +26,7 @@ module.exports = function (grunt) {
}
};

var filepaths = grunt.file.expandFiles(this.file.src);
grunt.file.clearRequireCache(filepaths);
var filepaths = this.filesSrc;
var paths = filepaths.map(path.resolve),
options = this.data.options || {},
reporter = options.reporter || 'dotmatrix';
Expand All @@ -61,14 +48,4 @@ module.exports = function (grunt) {
});
}
);

// ==========================================================================
// HELPERS
// ==========================================================================

// grunt.registerHelper('it', function () {
// return 'it!!!';
// });

}
;
};
2 changes: 1 addition & 1 deletion test/it_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports['it'] = {
// setup here
done();
},
'helper': function (test) {
'default_options': function (test) {
test.expect(1);
// tests here
test.equal(grunt.helper('it'), 'it!!!', 'should return the correct value.');
Expand Down

0 comments on commit 0973594

Please sign in to comment.