RandomGeneratorUtils.spec.ts 545 B

123456789101112
  1. import { assert } from 'chai';
  2. import { RandomGeneratorUtils } from '../../../src/utils/RandomGeneratorUtils';
  3. describe('RandomGeneratorUtils', () => {
  4. describe('getRandomVariableName (length: number = 6): string', () => {
  5. it('should return a string of given length with random variable name', () => {
  6. assert.match(RandomGeneratorUtils.getRandomVariableName(4, true, false), /^_0x(\w){4}$/);
  7. assert.match(RandomGeneratorUtils.getRandomVariableName(6, true, true), /^_0x(\w){4,6}$/);
  8. });
  9. });
  10. });