From 49c7fefb4b0b2d24444d5d1f94c9e0fe5c54ddac Mon Sep 17 00:00:00 2001 From: Harry Garrood Date: Fri, 1 Apr 2016 20:02:55 -0500 Subject: [PATCH] Fix eslint failures --- lib/commands/version.js | 4 ++-- test/commands/version.js | 42 ++++++++++++++++++++-------------------- test/helpers.js | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/commands/version.js b/lib/commands/version.js index 28fde95a5..52e181ae6 100644 --- a/lib/commands/version.js +++ b/lib/commands/version.js @@ -29,7 +29,7 @@ function bump(project, versionArg, message) { } }) .then(project.getJson.bind(project)) - .then(function(/*json (ignored)*/) { + .then(function (/*json (ignored)*/) { return currentGitVersion(cwd); }) .then(function (currentVersion) { @@ -110,7 +110,7 @@ function gitCommitAndTag(cwd, newVersion, message) { function currentGitVersion(cwd) { return Q.nfcall(execFile, 'git', ['tag'], {env: process.env, cwd: cwd}) - .then(function(res) { + .then(function (res) { var versions = res[0] .split(/\r?\n/) .map(stripV) diff --git a/test/commands/version.js b/test/commands/version.js index 65861f795..5d0a6f6e5 100644 --- a/test/commands/version.js +++ b/test/commands/version.js @@ -16,39 +16,39 @@ describe('bower version', function () { var packageWithoutTags = new helpers.TempDir({}); - it('bumps patch version', function() { + it('bumps patch version', function () { mainPackage.prepareGit(); - return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(function () { expect(mainPackage.latestGitTag()).to.be('0.0.1'); }); }); - it('bumps minor version', function() { + it('bumps minor version', function () { mainPackage.prepareGit(); - return helpers.run(version, ['minor', {}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['minor', {}, { cwd: mainPackage.path }]).then(function () { expect(mainPackage.latestGitTag()).to.be('0.1.0'); }); }); - it('bumps major version', function() { + it('bumps major version', function () { mainPackage.prepareGit(); - return helpers.run(version, ['major', {}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['major', {}, { cwd: mainPackage.path }]).then(function () { expect(mainPackage.latestGitTag()).to.be('1.0.0'); }); }); - it('changes version', function() { + it('changes version', function () { mainPackage.prepareGit(); - return helpers.run(version, ['1.2.3', {}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['1.2.3', {}, { cwd: mainPackage.path }]).then(function () { expect(mainPackage.latestGitTag()).to.be('1.2.3'); }); }); - it('returns the new version', function() { + it('returns the new version', function () { mainPackage.prepareGit(); return helpers.run(version, ['major', {}, { cwd: mainPackage.path }]).then(function (results) { @@ -56,40 +56,40 @@ describe('bower version', function () { }); }); - it('fails on a dirty git repository', function() { + it('fails on a dirty git repository', function () { mainPackage.prepareGit(); mainPackage.create({ 'dirty.txt': 'This file has not been committed' }); - return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(null, function(err) { + return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(null, function (err) { expect(err).to.be.an(Error); expect(err.code).to.be('ENOTGITREPOSITORY'); }); }); - it('fails when the version is not changed', function() { + it('fails when the version is not changed', function () { mainPackage.prepareGit(); - return helpers.run(version, ['0.0.0', {}, { cwd: mainPackage.path }]).then(null, function(err) { + return helpers.run(version, ['0.0.0', {}, { cwd: mainPackage.path }]).then(null, function (err) { expect(err).to.be.an(Error); expect(err.code).to.be('EVERSIONNOTCHANGED'); }); }); - it('fails with an invalid argument', function() { + it('fails with an invalid argument', function () { mainPackage.prepareGit(); - return helpers.run(version, ['lol', {}, { cwd: mainPackage.path }]).then(null, function(err) { + return helpers.run(version, ['lol', {}, { cwd: mainPackage.path }]).then(null, function (err) { expect(err).to.be.an(Error); expect(err.code).to.be('EINVALIDVERSION'); }); }); - it('bumps with custom commit message', function() { + it('bumps with custom commit message', function () { mainPackage.prepareGit(); - return helpers.run(version, ['patch', { message: 'Bumping %s, because what'}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['patch', { message: 'Bumping %s, because what'}, { cwd: mainPackage.path }]).then(function () { var tags = mainPackage.git('tag'); expect(tags).to.be('v0.0.0\nv0.0.1\n'); var message = mainPackage.git('log', '--pretty=format:%s', '-n1'); @@ -97,10 +97,10 @@ describe('bower version', function () { }); }); - it('creates commit and tags', function() { + it('creates commit and tags', function () { mainPackage.prepareGit(); - return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(function() { + return helpers.run(version, ['patch', {}, { cwd: mainPackage.path }]).then(function () { var tags = mainPackage.git('tag'); expect(tags).to.be('v0.0.0\nv0.0.1\n'); var message = mainPackage.git('log', '--pretty=format:%s', '-n1'); @@ -108,7 +108,7 @@ describe('bower version', function () { }); }); - it('assumes v0.0.0 when no tags exist', function() { + it('assumes v0.0.0 when no tags exist', function () { packageWithoutTags.prepareGit(); packageWithoutTags.create({ 'index.js': 'console.log("hello, world");' @@ -116,7 +116,7 @@ describe('bower version', function () { packageWithoutTags.git('add', '-A'); packageWithoutTags.git('commit', '-m"commit"'); - return helpers.run(version, ['major', {}, { cwd: packageWithoutTags.path }]).then(function() { + return helpers.run(version, ['major', {}, { cwd: packageWithoutTags.path }]).then(function () { expect(packageWithoutTags.latestGitTag()).to.be('1.0.0'); }); }); diff --git a/test/helpers.js b/test/helpers.js index dff1a81d8..fa670d545 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -159,7 +159,7 @@ exports.TempDir = (function () { TempDir.prototype.latestGitTag = function () { var versions = this.git('tag') .split(/\r?\n/) - .map(function(t) { return t.slice(1); }) + .map(function (t) { return t.slice(1); }) .filter(semver.valid) .sort(semver.compare);