mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
ddb6a22396
* feat: signature package * feat: signature package
19 lines
481 B
TypeScript
19 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');
|
|
});
|