mirror of
https://github.com/SunRed/haste-server.git
synced 2024-11-24 02:00:17 +01:00
7808ccf009
-Tests were not brought up to date with some updates that were done to key generator modules. -Apparently original creator had no idea that 'y' is a vowel; fixed this issue and reflected changes in actual files.
23 lines
613 B
JavaScript
23 lines
613 B
JavaScript
/* global describe, it */
|
|
|
|
const assert = require('assert');
|
|
const Generator = require('../../lib/key_generators/phonetic');
|
|
|
|
describe('KeyGenerator', () => {
|
|
describe('phonetic', () => {
|
|
it('should return a key of the proper length', () => {
|
|
const gen = new Generator();
|
|
assert.strictEqual(6, gen.createKey(6).length);
|
|
});
|
|
|
|
it('should alternate consonants and vowels', () => {
|
|
const gen = new Generator();
|
|
|
|
const vowels = 'aeiouy';
|
|
const key = gen.createKey(3);
|
|
|
|
if (vowels.includes(key[0])) assert.ok(vowels.includes(key[2]));
|
|
else assert.ok(vowels.includes(key[1]));
|
|
});
|
|
});
|
|
});
|