mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
ddb6a22396
* feat: signature package * feat: signature package
18 lines
481 B
TypeScript
18 lines
481 B
TypeScript
import {
|
|
TOKEN_VALID_LENGTH,
|
|
createTarballHash,
|
|
generateRandomSecretKey,
|
|
stringToMD5,
|
|
} from '../src/utils';
|
|
|
|
test('token generation length is valid', () => {
|
|
expect(generateRandomSecretKey()).toHaveLength(TOKEN_VALID_LENGTH);
|
|
});
|
|
|
|
test('string to md5 has valid length', () => {
|
|
expect(stringToMD5(Buffer.from('foo'))).toHaveLength(32);
|
|
});
|
|
|
|
test('create a hash of content', () => {
|
|
expect(typeof createTarballHash().update('1').digest('hex')).toEqual('string');
|
|
});
|