test(createModule): not installing semantic-release's deps all over again

This commit is contained in:
Stephan Bönnemann 2015-06-11 15:12:02 -07:00
parent f0bb39a22e
commit bd715dfdf4
6 changed files with 9 additions and 13 deletions

View File

@ -16,7 +16,7 @@ module.exports = function (t, message, version, code, name, cwd) {
.exec('git commit --allow-empty -m "' + message + '"') .exec('git commit --allow-empty -m "' + message + '"')
.run('npm run prepublish') .run('npm run prepublish')
.code(code) .code(code)
.stdout(/> semantic-release pre\n\nDetermining new version\n/m) .stdout(/semantic-release.js pre\n\nDetermining new version\n/m)
.end(function (err) { .end(function (err) {
t.error(err, 'nixt') t.error(err, 'nixt')

View File

@ -13,12 +13,9 @@ module.exports = function (input) {
var pkg = defaults((typeof input === 'object' ? input : {}), { var pkg = defaults((typeof input === 'object' ? input : {}), {
name: id, name: id,
version: '0.0.0', version: '0.0.0',
devDependencies: {
'semantic-release': 'file:../../../'
},
scripts: { scripts: {
prepublish: 'semantic-release pre', prepublish: '../../../bin/semantic-release.js pre',
postpublish: 'semantic-release post' postpublish: '../../../bin/semantic-release.js post'
}, },
publishConfig: { publishConfig: {
registry: 'http://localhost:4873/' registry: 'http://localhost:4873/'
@ -36,8 +33,7 @@ module.exports = function (input) {
'git add . && ' + 'git add . && ' +
'git config user.email "integration@test" && ' + 'git config user.email "integration@test" && ' +
'git config user.name "Integration Test" && ' + 'git config user.name "Integration Test" && ' +
'git commit -m "initial" && ' + 'git commit -m "initial"'
'npm install'
, efh(cb)(function (stdout) { , efh(cb)(function (stdout) {
cb(null, id, cwd) cb(null, id, cwd)
})) }))

View File

@ -26,7 +26,7 @@ module.exports = function (test, createModule) {
.cwd(cwd) .cwd(cwd)
.run(command) .run(command)
.code(0) .code(0)
.stdout(/> semantic-release pre\n$/m) .stdout(/semantic-release.js pre\n$/m)
.end(function (err) { .end(function (err) {
t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package') t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package')
t.error(err, 'nixt') t.error(err, 'nixt')

View File

@ -33,7 +33,7 @@ module.exports = function (test, createModule) {
t.plan(1) t.plan(1)
base.clone() base.clone()
.stdout(/> semantic-release post\n\nGenerating changelog from.*\nParsed/m) .stdout(/semantic-release.js post\n\nGenerating changelog from.*\nParsed/m)
.run('npm run postpublish') .run('npm run postpublish')
.end(function (err) { .end(function (err) {
t.error(err, 'nixt') t.error(err, 'nixt')
@ -44,7 +44,7 @@ module.exports = function (test, createModule) {
t.plan(1) t.plan(1)
base.clone() base.clone()
.stdout(/> semantic-release post\n\nGenerating changelog from.*\nParsed/m) .stdout(/semantic-release.js post\n\nGenerating changelog from.*\nParsed/m)
.exec('git checkout `git rev-parse HEAD`') .exec('git checkout `git rev-parse HEAD`')
.run('npm run postpublish') .run('npm run postpublish')
.end(function (err) { .end(function (err) {

View File

@ -20,7 +20,7 @@ module.exports = function (test, createModule) {
nixt() nixt()
.cwd(cwd) .cwd(cwd)
.exec('git remote add origin git@github.com:user/repo.git') .exec('git remote add origin git@github.com:user/repo.git')
.run('./node_modules/.bin/semantic-release setup') .run('../../../bin/semantic-release.js setup')
.code(0) .code(0)
.end(function (err) { .end(function (err) {
t.error(err, 'nixt') t.error(err, 'nixt')

View File

@ -8,7 +8,7 @@ module.exports = function (test, createModule) {
createModule({ createModule({
repository: {}, repository: {},
scripts: { scripts: {
prepublish: 'semantic-release pre --no-token' prepublish: '../../../bin/semantic-release.js pre'
} }
}, efh()(function (name, cwd) { }, efh()(function (name, cwd) {
t.test('verify package and options before publishing', function (t) { t.test('verify package and options before publishing', function (t) {