-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
50 lines (32 loc) · 1.11 KB
/
test.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// --------------------------------------------------------------------------------------------------------------------
"use strict"
// npm
const test = require('tape')
// local
const namez = require('./')
// --------------------------------------------------------------------------------------------------------------------
test('defaults', (t) => {
t.plan(1)
const name = namez()
t.equal(name.split('-').length, 3, 'Length is three, using the - separator')
t.end()
})
test('separator', (t) => {
t.plan(1)
const name = namez({ separator : ' ' })
t.equal(name.split(' ').length, 3, 'Length is three, using a space separator')
t.end()
})
test('upper', (t) => {
t.plan(1)
const name = namez({ format : 'upper' })
t.equal(name.match(/a-z/), null, 'No lowercase letters when asking for upper')
t.end()
})
test('upper', (t) => {
t.plan(1)
const name = namez({ format : 'lower' })
t.equal(name.match(/A-Z/), null, 'No uppcase letters when asking for lower')
t.end()
})
// --------------------------------------------------------------------------------------------------------------------