Skip to content

Commit

Permalink
update to [email protected] and testing cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiemonge committed Feb 18, 2016
1 parent 8bd3130 commit eb704b3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
test/temp
test/tmp
9 changes: 6 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';
var path = require('path');
var yeoman = require('yeoman-generator');
var generators = require('yeoman-generator');
var sortedObject = require('sorted-object');
var _ = require('underscore');

module.exports = yeoman.generators.Base.extend({
module.exports = generators.Base.extend({
initializing: function () {
function arrayFromString(str) {
return str.split(',').filter(function (check) {
Expand Down Expand Up @@ -177,7 +177,10 @@ module.exports = yeoman.generators.Base.extend({

this.fs.copyTpl(
this.templatePath(this.options['config-file']),
this.destinationPath(path.join(this.options['config-path'], this.options['config-file'])), {
this.destinationPath(
path.join(this.options['config-path'], this.options['config-file'])
),
{
basePath: this.options['base-path'],
frameworks: this.frameworks,
fileComments: this.options['files-comments'],
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
"karma"
],
"dependencies": {
"underscore": "^1.6.0",
"yeoman-generator": "^0.19.1",
"underscore": "^1.8.3",
"yeoman-generator": "^0.22.5",
"sorted-object": "~1.0.0"
},
"devDependencies": {
"mocha": "*"
"mocha": "*",
"yeoman-assert": "^2.1.1",
"yeoman-test": "^1.1.0"
}
}
14 changes: 7 additions & 7 deletions test/config.mock.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"base-path": "<%= basePath %>",
"frameworks": <%= JSON.stringify(frameworks) %>,
"files": <%= JSON.stringify(configFiles) %>,
"exclude": <%= JSON.stringify(exclude) %>,
"port": <%= port %>,
"browsers": <%= JSON.stringify(browsers) %>,
"plugins": <%= JSON.stringify(plugins) %>
"base-path": "<%- basePath %>",
"frameworks": <%- JSON.stringify(frameworks) %>,
"files": <%- JSON.stringify(configFiles) %>,
"exclude": <%- JSON.stringify(exclude) %>,
"port": <%- port %>,
"browsers": <%- JSON.stringify(browsers) %>,
"plugins": <%- JSON.stringify(plugins) %>
}
4 changes: 2 additions & 2 deletions test/test-creation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*global describe, beforeEach, it */
'use strict';
var join = require('path').join;
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var helpers = require('yeoman-test');
var assert = require('yeoman-assert');

describe('Karma generator creation test', function () {
describe('creates expected files', function () {
Expand Down
8 changes: 0 additions & 8 deletions test/test-load.js

This file was deleted.

9 changes: 4 additions & 5 deletions test/test-options.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*global describe, it */
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-test');
var assert = require('yeoman-assert');

describe('Karma generator options test', function () {
it('creates expected options', function (done) {
Expand All @@ -24,13 +24,12 @@ describe('Karma generator options test', function () {
};

helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(__dirname, 'temp'))
.inDir(path.join(__dirname, 'tmp'))
.withOptions(config)
.on('end', function () {
var frameworks = config.frameworks.split(',');
var test = require(path.resolve(
config['config-path'],
config['config-file']
config['config-path'], config['config-file']
));

assert.equal(config['base-path'], test['base-path']);
Expand Down

0 comments on commit eb704b3

Please sign in to comment.