mirror of
https://github.com/cupcakearmy/occulto.git
synced 2026-04-02 20:15:29 +00:00
2.0.0 (#3)
* rewrite * testing worklflow * sprcify version * config stuff * add hash as buffer * delete docs * use typedarray everywhere and docs * readme * aes * cleanup * rsa * testing with playwright * fix playwright * readme * docs * update deps * use headless * add prepublish * build pipeline * move types up * move types up * add types legacy * packaging * versions bump * cleanup * maybe this time * drop support for commonjs * version bump * cleanup
This commit is contained in:
18
test/random.spec.js
Normal file
18
test/random.spec.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { getRandomBytes } from '../dist/index.js'
|
||||
import { Promises } from './utils.js'
|
||||
|
||||
describe('Random', () => {
|
||||
it('Should be able to create random values', async () => {
|
||||
const buffer = await getRandomBytes(8)
|
||||
chai.expect(buffer).to.be.instanceOf(Uint8Array)
|
||||
chai.expect(buffer.byteLength).to.equal(8)
|
||||
})
|
||||
|
||||
it('Should throw error on empty array', async () => {
|
||||
await Promises.reject(() => getRandomBytes(0))
|
||||
})
|
||||
|
||||
it('Should throw error on negative bytes', async () => {
|
||||
await Promises.reject(() => getRandomBytes(-1))
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user