diff --git a/package.json b/package.json index ccecdb52..231f1062 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "babel": "^5.5.8", "coveralls": "^2.11.2", "mkdirp": "^0.5.1", + "nixt": "^0.4.1", "nock": "^2.5.0", "nyc": "^2.3.0", "npm-registry-couchapp": "^2.6.11", diff --git a/src/lib/verify.js b/src/lib/verify.js index e1fb4299..c8a20810 100644 --- a/src/lib/verify.js +++ b/src/lib/verify.js @@ -26,7 +26,7 @@ module.exports = function (pkg, options, env) { )) } - if (!env.NPM_TOKEN) { + if (!(env.NPM_TOKEN || (env.NPM_OLD_TOKEN && env.NPM_EMAIL))) { errors.push(new SemanticReleaseError( 'No npm token specified.', 'ENONPMTOKEN' diff --git a/test/lib/base-scenario.js b/test/lib/base-scenario.js new file mode 100644 index 00000000..2879b350 --- /dev/null +++ b/test/lib/base-scenario.js @@ -0,0 +1,13 @@ +const nixt = require('nixt') + +module.exports = function (cwd, uri) { + return nixt() + .cwd(cwd) + .env('NPM_OLD_TOKEN', 'aW50ZWdyYXRpb246c3VjaHNlY3VyZQ==') + .env('NPM_EMAIL', 'integration@test.com') + .env('GH_TOKEN', 'ghtoken') + .env('CI', true) + .env('npm_config_registry', uri) + .env('npm_config_loglevel', 'info') + .clone() +}