random.js 341 B

12345678910111213
  1. "use strict";
  2. var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/);
  3. module.exports = function (t, a) {
  4. a(typeof t(), "string");
  5. a.ok(t().length > 7);
  6. a.not(t({ isUnique: true }), t({ isUnique: true }));
  7. a.ok(isValidFormat(t()));
  8. a(t({ length: 1 }).length, 1);
  9. a(t({ length: 100 }).length, 100);
  10. a(t({ length: 0 }), "");
  11. };