parent
cc1f84cadc
commit
1948117ce7
|
|
@ -1,20 +1,5 @@
|
|||
import {createHash} from 'crypto';
|
||||
import {expect, test} from 'vitest';
|
||||
import {versions, sha256sum} from '../src';
|
||||
|
||||
test('versions', async () => {
|
||||
expect(versions).toBe(process.versions);
|
||||
});
|
||||
|
||||
|
||||
test('nodeCrypto', async () => {
|
||||
/**
|
||||
* Random string to test hashing
|
||||
*/
|
||||
const testString = Math.random().toString(36).slice(2, 7);
|
||||
const expectedHash = createHash('sha256')
|
||||
.update(testString)
|
||||
.digest('hex');
|
||||
|
||||
expect(sha256sum(testString)).toBe(expectedHash);
|
||||
});
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
Reference in New Issue