Welcome to mirror list, hosted at ThFree Co, Russian Federation.

email.test.js « test « npm-user-validate « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1060a9354d6ccd5c72da22cd3e754dd7bcd1c3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()
})