Skip to content

Commit

Permalink
add grunt file to your project
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliew committed Jan 8, 2016
1 parent 1381790 commit e4a2556
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-sails-diy",
"version": "0.0.7",
"version": "0.0.8",
"description": "sails yeoman generator",
"main": "generators/app/index.js",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion src/app/questions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ module.exports = {
app: app,
cron: cron,
config: config,
views: views
views: views,
grunt:grunt
};
3 changes: 3 additions & 0 deletions src/app/steps/prompting.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,8 @@ module.exports = {
//}
askViewEngine: function() {
askQuestions.call(this, 'Views', questions.views, this.async());
},
askGrunt: function() {
askQuestions.call(this, 'Grunt', questions.grunt, this.async());
}
};
41 changes: 41 additions & 0 deletions test/unit/grunt.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

var path = require('path');
var generators = require('yeoman-generator');

describe('sails-diy:grunt', function(){
describe('Should properly scaffold empty grunt configuration file', function(){
before(function(done){
generators.test.run(path.join(__dirname, '../../src/grunt')).on('end', done)
});

it('Should properly create configuration files', function(){
generators.assert.file([
'Gruntfile.js',
'tasks/config/clean.js',
'tasks/config/coffee.js',
'tasks/config/concat.js',
'tasks/config/copy.js',
'tasks/config/cssmin.js',
'tasks/config/jst.js',
'tasks/config/less.js',
'tasks/config/sails-linker.js',
'tasks/config/sync.js',
'tasks/config/uglify.js',
'tasks/config/watch.js',
'tasks/register/build.js',
'tasks/register/buildProd.js',
'tasks/register/compileAssets.js',
'tasks/register/default.js',
'tasks/register/linkAssets.js',
'tasks/register/linkAssetsBuild.js',
'tasks/register/linkAssetsBuildProd.js',
'tasks/register/prod.js',
'tasks/register/syncAssets.js',
'tasks/pipeline.js',
'tasks/README.md'
]);
});
});


});

0 comments on commit e4a2556

Please sign in to comment.