1
0
Fork 0
mirror of https://github.com/seejohnrun/haste-server.git synced 2024-11-23 05:01:21 +00:00
haste-server/test/key_generators/random_spec.js
2017-10-31 20:55:51 -04:00

19 lines
529 B
JavaScript

/* global describe, it */
const assert = require('assert');
const Generator = require('../../lib/key_generators/random');
describe('RandomKeyGenerator', () => {
describe('randomKey', () => {
it('should return a key of the proper length', () => {
const gen = new Generator();
assert.equal(6, gen.createKey(6).length);
});
it('should use a key from the given keyset if given', () => {
const gen = new Generator({keyspace: 'A'});
assert.equal('AAAAAA', gen.createKey(6));
});
});
});