node/deps/npm/node_modules/npm-user-validate/test/pw.test.js

33 lines
526 B
JavaScript
Raw Normal View History

2013-05-15 05:37:59 +08:00
var test = require('tap').test
var v = require('../npm-user-validate.js').pw
test('pw contains a \'', function (t) {
err = v('\'')
2014-06-06 06:18:15 +08:00
t.type(err, 'null')
2013-05-15 05:37:59 +08:00
t.end()
})
test('pw contains a :', function (t) {
err = v(':')
2014-06-06 06:18:15 +08:00
t.type(err, 'null')
2013-05-15 05:37:59 +08:00
t.end()
})
test('pw contains a @', function (t) {
err = v('@')
2014-06-06 06:18:15 +08:00
t.notOk(err, 'null')
2013-05-15 05:37:59 +08:00
t.end()
})
test('pw contains a "', function (t) {
err = v('"')
2014-06-06 06:18:15 +08:00
t.type(err, 'null')
2013-05-15 05:37:59 +08:00
t.end()
})
test('pw is ok', function (t) {
err = v('duck')
t.type(err, 'null')
t.end()
2014-06-06 06:18:15 +08:00
})