From d5a8cb1935c7b3135617dfdca3ef68e1ec9a1171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6nnemann?= Date: Sun, 22 Mar 2015 10:44:19 +0100 Subject: [PATCH] style: adhere to standard style --- lib/error.js | 2 +- src/setup.js | 5 +---- tests/scenarios/install.js | 2 +- tests/scenarios/postpublish.js | 4 ++-- tests/scenarios/prepublish.js | 6 +++--- tests/scenarios/publish.js | 2 +- tests/scenarios/setup.js | 2 +- tests/scenarios/verify.js | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/error.js b/lib/error.js index 25ffbe8c60..456549de85 100644 --- a/lib/error.js +++ b/lib/error.js @@ -4,7 +4,7 @@ var efh = require('error-first-handler') module.exports = { efh: efh, - standard: efh(function(err) { + standard: efh(function (err) { console.log('Something went wrong:') if (typeof err === 'string') return console.log(err) if (err instanceof Error) return console.log(err.message) diff --git a/src/setup.js b/src/setup.js index 7274fb28b5..9eb7a4803a 100644 --- a/src/setup.js +++ b/src/setup.js @@ -28,10 +28,7 @@ module.exports = function () { var config = ini.decode(fs.readFileSync('./.git/config') + '') var repo = config['remote "origin"'].url - if (repo) pkg.repository = { - type: 'git', - url: ghUrl(repo) - } + if (repo) pkg.repository = { type: 'git', url: ghUrl(repo) } } // set up devDependency diff --git a/tests/scenarios/install.js b/tests/scenarios/install.js index f6c48071d4..ea78cfe82c 100644 --- a/tests/scenarios/install.js +++ b/tests/scenarios/install.js @@ -23,7 +23,7 @@ module.exports = function (test, createModule) { .run(command) .code(0) .stdout(/> semantic-release pre\n$/m) - .end(function(err) { + .end(function (err) { t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package') t.error(err, 'nixt') }) diff --git a/tests/scenarios/postpublish.js b/tests/scenarios/postpublish.js index cd644f35f8..ca0014b54e 100644 --- a/tests/scenarios/postpublish.js +++ b/tests/scenarios/postpublish.js @@ -39,7 +39,7 @@ module.exports = function (test, createModule) { base.clone() .run('npm run postpublish') - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') }) }) @@ -50,7 +50,7 @@ module.exports = function (test, createModule) { base.clone() .exec('git checkout `git rev-parse HEAD`') .run('npm run postpublish') - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') }) }) diff --git a/tests/scenarios/prepublish.js b/tests/scenarios/prepublish.js index 3f34cd372b..2fdd0e39a2 100644 --- a/tests/scenarios/prepublish.js +++ b/tests/scenarios/prepublish.js @@ -28,7 +28,7 @@ module.exports = function (test, createModule) { .run('npm run prepublish') .code(code) .stdout(/> semantic-release pre\n\nDetermining new version\n/m) - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') var pkg = JSON.parse(fs.readFileSync(cwd + '/package.json')) @@ -38,8 +38,8 @@ module.exports = function (test, createModule) { return t.error(null, 'no publish') } - exec('npm publish --ignore-scripts', {cwd: cwd}, function(err) { - setTimeout(function() { + exec('npm publish --ignore-scripts', {cwd: cwd}, function (err) { + setTimeout(function () { t.error(err, 'publish') }, 300) }) diff --git a/tests/scenarios/publish.js b/tests/scenarios/publish.js index 499a74ee50..4826d22f45 100644 --- a/tests/scenarios/publish.js +++ b/tests/scenarios/publish.js @@ -27,7 +27,7 @@ module.exports = function (test, createModule) { .run(command) .code(1) .stdout(/Everything is alright/) - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') }) }) diff --git a/tests/scenarios/setup.js b/tests/scenarios/setup.js index 1717174f6e..707c3bfd53 100644 --- a/tests/scenarios/setup.js +++ b/tests/scenarios/setup.js @@ -22,7 +22,7 @@ module.exports = function (test, createModule) { .exec('git remote add origin git@github.com:user/repo.git') .run('./node_modules/.bin/semantic-release setup') .code(0) - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') var pkg = JSON.parse(readFile(join(cwd, 'package.json'))) diff --git a/tests/scenarios/verify.js b/tests/scenarios/verify.js index 460b8049c6..f9d5bbf5dc 100644 --- a/tests/scenarios/verify.js +++ b/tests/scenarios/verify.js @@ -25,7 +25,7 @@ module.exports = function (test, createModule) { , 'm' )) .code(1) - .end(function(err) { + .end(function (err) { t.error(err, 'nixt') }) })