fix: passphrase generator test regex

This commit is contained in:
Aetherinox 2024-05-03 12:35:40 -07:00
parent 853a7e6e39
commit d0533907af
No known key found for this signature in database
GPG Key ID: CB5C4C30CD0D4028
1 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,7 @@ describe('PasswordGenerator', () => {
it('should generate a password with ambiguous characters', () => { it('should generate a password with ambiguous characters', () => {
expect(PasswordGenerator.generate({ length: 10, ambiguous: true })).to.match( expect(PasswordGenerator.generate({ length: 10, ambiguous: true })).to.match(
new RegExp(`^[O0oIl]{10}$`) /^[O0oIl]{10}$/
); );
}); });
@ -100,7 +100,7 @@ describe('PasswordGenerator', () => {
spaces: true, spaces: true,
upper: true upper: true
}) })
).to.match(/^\w+(?:[0-9] \w+){5,}$/); ).to.match(/^[\w-]+(?:[\d]\s[a-zA-Z]+){5,}\d+$/);
}); });
it('should generate passphrase with 7 words seperated by hyphens', () => { it('should generate passphrase with 7 words seperated by hyphens', () => {
@ -128,5 +128,4 @@ describe('PasswordGenerator', () => {
}) })
).to.match(/^\w+(?: [\-] \w+[0-9]+){9,}$/); ).to.match(/^\w+(?: [\-] \w+[0-9]+){9,}$/);
}); });
}); });