Skip to content

Commit

Permalink
There was a bug in the suite template. Sometimes the all.js file woul…
Browse files Browse the repository at this point in the history
…d not write properly
  • Loading branch information
glamb committed Mar 20, 2015
1 parent 11b2499 commit ff81b0c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 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-internjs-pageobjects",
"version": "0.1.1",
"version": "0.1.2",
"description": "Yeoman generator",
"license": "MIT",
"main": "app/index.js",
Expand Down
35 changes: 17 additions & 18 deletions suite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,25 @@ module.exports = yeoman.generators.Base.extend({
done();
}.bind(this));
},

files: function() {
this.template('_testsuite.js', 'tests/'+this.pageName+'/'+_.snakeCase(this.suiteName)+'.js');
var testSuites = this.expand('tests/'+this.pageName+'/*');
_.forEach(testSuites, function(test) {
tests.push(_.last(test.split(path.sep)));
});
console.info('before remove: '+tests);
_.pull(tests, 'all.js');
console.info('after remove: '+tests);

this.fs.copyTpl(
this.templatePath('_all.js'),
this.destinationPath('tests/'+this.pageName+'/all.js'),
{ tests: tests }
);
writing:{
files: function() {
this.template('_testsuite.js', 'tests/'+this.pageName+'/'+_.snakeCase(this.suiteName)+'.js');
},
},

suiteBootstrapper: function () {

end: {
suiteBootstrapper: function () {
var testSuites = this.expand('tests/'+this.pageName+'/*');
_.forEach(testSuites, function(test) {
tests.push(_.last(test.split(path.sep)));
});
_.pull(tests, 'all.js');

this.fs.copyTpl(
this.templatePath('_all.js'),
this.destinationPath('tests/'+this.pageName+'/all.js'),
{ tests: tests }
);
},
},
});
2 changes: 1 addition & 1 deletion suite/templates/_testsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define([
'intern!object',
'intern/chai!assert',
'pageObjects/<%= _.capitalize(pageName) %>'
], function (intern, registerSuite, assert, _.capitalize(pageName)) {
], function (intern, registerSuite, assert, <%= _.capitalize(pageName) %>) {
'use strict';

registerSuite(function () {
Expand Down

0 comments on commit ff81b0c

Please sign in to comment.