Projekt

Obecné

Profil

Stáhnout (525 Bajtů) Statistiky
| Větev: | Revize:
1
'use strict'
2
var t = require('tap')
3
var uniqueSlug = require('../index.js')
4

    
5
t.plan(5)
6
var slugA = uniqueSlug()
7
t.is(slugA.length, 8, 'random slugs are 8 chars')
8
t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same")
9
var base = '/path/to/thingy'
10
var slugB = uniqueSlug(base)
11
t.is(slugB.length, 8, 'string based slugs are 8 chars')
12
t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same')
13
t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different')
    (1-1/1)