1df75a5b1ef71a35e0c2b2b424083df3a6fdb4aa98488dd136ffe1deccc0e12102f259f2be74d65a45bbeececfe07318f4ee27b71e91868564bf482404fed8 525 B

12345678910111213
  1. 'use strict'
  2. var t = require('tap')
  3. var uniqueSlug = require('../index.js')
  4. t.plan(5)
  5. var slugA = uniqueSlug()
  6. t.is(slugA.length, 8, 'random slugs are 8 chars')
  7. t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same")
  8. var base = '/path/to/thingy'
  9. var slugB = uniqueSlug(base)
  10. t.is(slugB.length, 8, 'string based slugs are 8 chars')
  11. t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same')
  12. t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different')