UNPKG

1.84 kBJavaScriptView Raw
1"use strict";
2/**
3 * This file is part of the @egodigital/egoose distribution.
4 * Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/)
5 *
6 * @egodigital/egoose is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation, version 3.
9 *
10 * @egodigital/egoose is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18Object.defineProperty(exports, "__esModule", { value: true });
19const assert = require("assert");
20const mocha_1 = require("mocha");
21const egoose = require("../index");
22mocha_1.describe('#randChars', function () {
23 mocha_1.describe('async', function () {
24 mocha_1.it('should return a random string', async function () {
25 for (let i = 1; i <= 1000; i++) {
26 const CHARS = await egoose.randChars(i);
27 assert.ok(typeof CHARS === 'string');
28 assert.equal(CHARS.length, i);
29 assert.strictEqual(CHARS.length, i);
30 }
31 });
32 });
33 mocha_1.describe('sync', function () {
34 mocha_1.it('should return a random string', function () {
35 for (let i = 1; i <= 1000; i++) {
36 const CHARS = egoose.randCharsSync(i);
37 assert.ok(typeof CHARS === 'string');
38 assert.equal(CHARS.length, i);
39 assert.strictEqual(CHARS.length, i);
40 }
41 });
42 });
43});
44//# sourceMappingURL=randChars.js.map
\No newline at end of file