From f66be912a98499cf0ad839a98ff2ea959f8ac0be Mon Sep 17 00:00:00 2001 From: Bryan Forbes Date: Sat, 19 Oct 2013 23:04:41 -0500 Subject: [PATCH] Moving things around --- app/index.js | 2 +- app/templates/src/app/tests/intern.js | 2 +- app/templates/src/app/tests/{all.js => unit.js} | 0 test/index.js | 14 ++++++++++---- 4 files changed, 12 insertions(+), 6 deletions(-) rename app/templates/src/app/tests/{all.js => unit.js} (100%) diff --git a/app/index.js b/app/index.js index 17afe97..caec9ab 100644 --- a/app/index.js +++ b/app/index.js @@ -166,7 +166,7 @@ DojoGenerator.prototype.appPackage = function appPackage() { else { this.template('src/app/resources/main.css', appPath + '/resources/main.css'); } - this.template('src/app/tests/all.js', appPath + '/tests/all.js'); + this.template('src/app/tests/unit.js', appPath + '/tests/unit.js'); this.template('src/app/tests/functional.js', appPath + '/tests/functional.js'); this.template('src/app/tests/dojoConfig.js', appPath + '/tests/dojoConfig.js'); this.template('src/app/tests/intern.js', appPath + '/tests/intern.js'); diff --git a/app/templates/src/app/tests/intern.js b/app/templates/src/app/tests/intern.js index 88a0822..66536e6 100644 --- a/app/templates/src/app/tests/intern.js +++ b/app/templates/src/app/tests/intern.js @@ -60,7 +60,7 @@ define({ }, // Non-functional test suite(s) to run in each browser - suites: [ '<%= appname %>/tests/all' ], + suites: [ '<%= appname %>/tests/unit' ], // Functional test suite(s) to run in each browser once non-functional tests are completed functionalSuites: [ '<%= appname %>/tests/functional' ], diff --git a/app/templates/src/app/tests/all.js b/app/templates/src/app/tests/unit.js similarity index 100% rename from app/templates/src/app/tests/all.js rename to app/templates/src/app/tests/unit.js diff --git a/test/index.js b/test/index.js index e52f7b0..a986e2d 100644 --- a/test/index.js +++ b/test/index.js @@ -39,17 +39,23 @@ var TestGenerator = module.exports = function TestGenerator(args, options) { this.appUrl = relativeAppUrl; this.testsUrl = relativeTestsUrl; this.baseUrl = relativeBaseUrl; + + this.on('end', function () { + console.log('Don\'t forget to add ' + path.join(this.appname, 'tests', this.subdir, this.name) + + ' to the dependency list in ' + + path.join('src', this.appname, 'tests', (this.functional ? 'functional' : 'unit') + '.js')); + }.bind(this)); }; util.inherits(TestGenerator, yeoman.generators.NamedBase); TestGenerator.prototype.files = function files() { - var testPath = path.join('src', this.appname, 'tests'); + var testPath = path.join('src', this.appname, 'tests', this.subdir); if (this.functional) { - this.template('functional.js', path.join(testPath, this.subdir, this.name + '.js')); - this.template('functional.html', path.join(testPath, this.subdir, this.name + '.html')); + this.template('functional.js', path.join(testPath, this.name + '.js')); + this.template('functional.html', path.join(testPath, this.name + '.html')); } else { - this.template('unit.js', path.join(testPath, this.subdir, this.name + '.js')); + this.template('unit.js', path.join(testPath, this.name + '.js')); } };