test(verify): setup requirement verification

This commit is contained in:
Stephan Bönnemann 2015-02-08 13:21:13 +01:00
parent 6f7b382130
commit 5f96cd4589
2 changed files with 35 additions and 0 deletions

View File

@ -8,3 +8,4 @@ require('./scenarios/install')(test, createModule)
require('./scenarios/prepublish')(test, createModule)
require('./scenarios/postpublish')(test, createModule)
require('./scenarios/publish')(test, createModule)
require('./scenarios/verify')(test, createModule)

34
tests/scenarios/verify.js Normal file
View File

@ -0,0 +1,34 @@
'use strict'
var efh = require('error-first-handler')
var nixt = require('nixt')
module.exports = function (test, createModule) {
createModule({
repository: {},
scripts: {
prepublish: 'semantic-release pre --no-token'
}
}, efh()(function (name, cwd) {
test('verify', function (t) {
t.test('verify package and options before publishing', function (t) {
t.plan(1)
nixt()
.cwd(cwd)
.env('CI', true)
.run('npm publish')
.stderr(new RegExp(
'You must define a GitHub token\.\n' +
'You must define your GitHub "repository" inside the "package.json"\.\n' +
'You must define your "scripts" inside the "package.json"\.'
, 'm'
))
.code(1)
.end(function(err) {
t.error(err, 'nixt')
})
})
})
}))
}