mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
504 B
26 lines
504 B
var test = require('tap').test
|
|
var v = require('../npm-user-validate.js').email
|
|
|
|
test('email misses an @', function (t) {
|
|
err = v('namedomain')
|
|
t.type(err, 'object')
|
|
t.end()
|
|
})
|
|
|
|
test('email misses a dot', function (t) {
|
|
err = v('name@domain')
|
|
t.type(err, 'object')
|
|
t.end()
|
|
})
|
|
|
|
test('email misses a string before the @', function (t) {
|
|
err = v('@domain')
|
|
t.type(err, 'object')
|
|
t.end()
|
|
})
|
|
|
|
test('email is ok', function (t) {
|
|
err = v('name@domain.com')
|
|
t.type(err, 'null')
|
|
t.end()
|
|
})
|