1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-24 02:00:17 +01:00
haste-server/test/key_generators/random.js

19 lines
509 B
JavaScript
Raw Normal View History

/* global describe, it */
const assert = require('assert');
const Generator = require('../../lib/key_generators/random');
describe('KeyGenerator', () => {
describe('random', () => {
2020-08-28 23:57:50 +02:00
it('should return a key of the proper length', () => {
const gen = new Generator();
assert.strictEqual(6, gen.createKey(6).length);
2020-08-28 23:57:50 +02:00
});
2020-08-28 23:57:50 +02:00
it('should use a key from the given keyset if given', () => {
const gen = new Generator({keyspace: 'A'});
assert.strictEqual('AAAAAA', gen.createKey(6));
2020-08-28 23:57:50 +02:00
});
});
});