mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
ec0ed397d9
- `yarn test` will look for files matching `*.test.js`, so this commit fixes the name for the tests
19 lines
569 B
JavaScript
19 lines
569 B
JavaScript
require('./utils');
|
|
const security = require('../');
|
|
|
|
describe('Lib: Security - Password', function () {
|
|
it('hash plain password', function () {
|
|
return security.password.hash('test')
|
|
.then(function (hash) {
|
|
hash.should.match(/^\$2[ayb]\$.{56}$/);
|
|
});
|
|
});
|
|
|
|
it('compare password', function () {
|
|
return security.password.compare('test', '$2a$10$we16f8rpbrFZ34xWj0/ZC.LTPUux8ler7bcdTs5qIleN6srRHhilG')
|
|
.then(function (valid) {
|
|
valid.should.be.true;
|
|
});
|
|
});
|
|
});
|