update deps, cleanup

This commit is contained in:
2026-06-01 01:05:14 +02:00
parent 4c61c067e6
commit 51c3e3d05f
22 changed files with 1590 additions and 2542 deletions
+19 -15
View File
@@ -1,18 +1,22 @@
import { describe, expect, it } from 'vitest'
import { getRandomBytes } from '../dist/index.js'
import { describe, expect, it } from "vitest";
import { getRandomBytes } from "../src/index.js";
describe('Random', () => {
it('Should be able to create random values', async () => {
const buffer = await getRandomBytes(8)
expect(buffer).instanceOf(Uint8Array)
expect(buffer.byteLength).toEqual(8)
})
describe("Random", () => {
it("Should be able to create random values", async () => {
const buffer = await getRandomBytes(8);
expect(buffer).instanceOf(Uint8Array);
expect(buffer.byteLength).toEqual(8);
});
it('Should throw error on empty array', async () => {
await expect(() => getRandomBytes(0)).rejects.toThrowErrorMatchingSnapshot()
})
it("Should throw error on empty array", async () => {
await expect(() =>
getRandomBytes(0),
).rejects.toThrowErrorMatchingSnapshot();
});
it('Should throw error on negative bytes', async () => {
await expect(() => getRandomBytes(-1)).rejects.toThrowErrorMatchingSnapshot()
})
})
it("Should throw error on negative bytes", async () => {
await expect(() =>
getRandomBytes(-1),
).rejects.toThrowErrorMatchingSnapshot();
});
});