From ca4d091f1a5753a541617a2a12aabe58d35e9fcf Mon Sep 17 00:00:00 2001 From: cueedee Date: Mon, 25 Jul 2016 17:09:18 +0200 Subject: [PATCH] feat(app generator): include tests on debug builds --- README.md | 8 ++++---- generators/app/index.js | 4 ++-- generators/app/templates/@Gruntfile.coffee | 6 ++++-- generators/app/templates/@README.md | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c3a11e72..fc94955e 100644 --- a/README.md +++ b/README.md @@ -169,8 +169,8 @@ Grunt can do more than just that; here's a recap of common grunt idioms: command | description :-- |:-- -`grunt [default]` | does a for-production, non-debugging, all-parts, minified build plus artifacts; -`grunt debug` | does a for-testing, debugging, all-parts except documentation, as-is build; +`grunt [default]` | does a for-production, non-debugging, all-parts, tested, minified build plus artifacts; +`grunt debug` | does a for-testing, debugging, all-parts except documentation, tested, as-is build; `grunt dev` | does a for-local, debugging, all-parts except documentation, as-is build;
_(**Note that this variant doesn't exit**. Instead it'll keep a close watch on filesystem changes, selectively re-triggering part builds as needed)_ `grunt doc` | will build just the code documentation; `grunt lint` | will just lint your code; @@ -182,13 +182,13 @@ command | description BAT comes with support for unit testing using [Mocha](http://mochajs.org/) and [Chai](http://chaijs.com/). The demo webapp has a basic (and admittedly, pretty unconnected) example of this. -You may already have guessed how to run your test suite; it's: +You may already have guessed how to independently run your test suite; it's: ```shell grunt test ``` -The default grunt task also includes the `test` task. You may or may not want to add it to your `dev` task too, depending on your workflow. +The default and `debug` grunt tasks also include the `test` task. You may or may not want to add it to your `dev` task too, depending on your workflow. ## ChangeLog diff --git a/generators/app/index.js b/generators/app/index.js index 70f38b2e..c3ce729f 100644 --- a/generators/app/index.js +++ b/generators/app/index.js @@ -630,10 +630,10 @@ var AppGenerator = generators.Base.extend( + '\n' + chalk.bold( ' * ' + chalk.yellow( 'grunt ' + chalk.cyan( '[' ) + 'default' + chalk.cyan( ']' ) + ' ' )) - + '- does a for-production, non-debugging, all-parts, minified build plus artifacts;\n' + + '- does a for-production, non-debugging, all-parts, tested, minified build plus artifacts;\n' + chalk.bold( ' * ' + chalk.yellow( 'grunt debug ' )) - + '- does a for-testing, debugging, all-parts except documentation, as-is build;\n' + + '- does a for-testing, debugging, all-parts except documentation, tested, as-is build;\n' + chalk.bold( ' * ' + chalk.yellow( 'grunt dev ' )) + '- does a for-local, debugging, all-parts except documentation, as-is build;\n' diff --git a/generators/app/templates/@Gruntfile.coffee b/generators/app/templates/@Gruntfile.coffee index 997efac6..07116ba2 100644 --- a/generators/app/templates/@Gruntfile.coffee +++ b/generators/app/templates/@Gruntfile.coffee @@ -115,8 +115,8 @@ ## ## Finally, this is how the main grunt commandline tasks are mapped to all of the above: ## -## * grunt [default] - does a for-production, non-debugging, all-parts, minified build plus artifacts; -## * grunt debug - does a for-testing, debugging, all-parts except documentation, as-is build; +## * grunt [default] - does a for-production, non-debugging, all-parts, tested, minified build plus artifacts; +## * grunt debug - does a for-testing, debugging, all-parts except documentation, tested, as-is build; ## * grunt dev - does a for-local, debugging, all-parts except documentation, as-is build; ## (Note that this variant doesn't exit. Instead, it'll keep a close watch on ## filesystem changes, selectively re-triggering part builds as needed) @@ -933,6 +933,8 @@ module.exports = ( grunt ) -> 'app:debug' + 'test' + 'compress:app_debug' ] ) diff --git a/generators/app/templates/@README.md b/generators/app/templates/@README.md index cb4adb0a..c8a86d4c 100644 --- a/generators/app/templates/@README.md +++ b/generators/app/templates/@README.md @@ -55,8 +55,8 @@ If you would like something different, here's a recap of most common grunt idiom command | description :-- |:-- -`grunt [default]` | does a for-production, non-debugging, all-parts, minified build plus artifacts; -`grunt debug` | does a for-testing, debugging, all-parts except documentation, as-is build; +`grunt [default]` | does a for-production, non-debugging, all-parts, tested, minified build plus artifacts; +`grunt debug` | does a for-testing, debugging, all-parts except documentation, tested, as-is build; `grunt dev` | does a for-local, debugging, all-parts except documentation, as-is build;
_(**Note that this variant doesn't exit**. Instead it'll keep a close watch on filesystem changes, selectively re-triggering part builds as needed)_ `grunt doc` | will build just the code documentation; `grunt lint` | will just lint your code;