Skip to content

Commit

Permalink
remove travis option
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiemonge committed Feb 18, 2016
1 parent 913bf40 commit 56e1119
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 54 deletions.
17 changes: 1 addition & 16 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ module.exports = generators.Base.extend({
this.options.plugins.push('karma-coffee-preprocessor');
}

this.option('travis', {
type: Boolean,
desc: 'Adds a .travis.yml file',
defaults: false
});

this.option('template-path', {
type: String,
desc: 'Path where the config files should be read from',
Expand Down Expand Up @@ -260,16 +254,7 @@ module.exports = generators.Base.extend({
this.gruntfile.registerTask('test', ['karma']);
},

setupTravis: function () {
if (!this.options.travis) {
return;
}

this.fs.copy(
this.templatePath('travis.yml'),
this.destinationPath('.travis.yml')
);

writeRunner: function () {
var data = this.fs.readJSON(this.destinationPath('package.json'));

if (!data) {
Expand Down
7 changes: 0 additions & 7 deletions generators/app/templates/travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ The full list:

Directory where Bower components are installed, if not in the default location.

* `--travis` Type: Boolean, Default: false

Enable [Travis CI](https://travis-ci.org/) config generation by adding a .travis.yaml file.

* `--gruntfile-path` Type: String, Default: ''

Path to a Gruntfile to edit. This is relative to your generators root directory. In other words, relative to `this.destinationRoot()` path.
Expand Down
28 changes: 1 addition & 27 deletions test/test-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,38 +68,12 @@ describe('Karma generator creation test', function () {
done();
});
});

it('creates a travis file but warns about missing package.json', function (done) {
gen.withOptions({travis: true})
.on('end', function () {
gen.generator.log.error = gen.generator.log.__olderror;
assert.file(['.travis.yml']);
assert(
logMessage.indexOf('Could not open package.json for reading.') > -1
);
done();
});
});
});

it('creates a travis file and updates package.json', function (done) {
helpers
.run(join(__dirname, '../generators/app'))
.withOptions({travis: true, force: true})
.inTmpDir(function (dir) {
require('fs').writeFileSync(join(dir,'package.json'), '{}');
})
.on('end', function () {
assert.file(['.travis.yml']);
assert.fileContent('package.json', /grunt test/);
done();
});
});

it('updates package.json with karma dependencies', function (done) {
helpers
.run(join(__dirname, '../generators/app'))
.withOptions({travis: true, force: true})
.withOptions({force: true})
.inTmpDir(function (dir) {
require('fs').writeFileSync(join(dir,'package.json'), '{"dependencies":{"grunt":"1.0.0"}}');
})
Expand Down

0 comments on commit 56e1119

Please # to comment.