17 lines
678 B
TypeScript
17 lines
678 B
TypeScript
import { describe, expect, it } from "@suaveplan/testing/runner";
|
|
import { NoopChunkValidator, noopChunkValidator } from "./validator.js";
|
|
|
|
describe("NoopChunkValidator", () => {
|
|
it("returns the input bytes unchanged", { timeout: 5000 }, async () => {
|
|
const validator = new NoopChunkValidator();
|
|
const data = new Uint8Array([1, 2, 3]);
|
|
const result = await validator.validate(0n, data);
|
|
expect(result.data).toBe(data);
|
|
});
|
|
|
|
it("exposes a singleton shorthand", { timeout: 5000 }, async () => {
|
|
const result = await noopChunkValidator.validate(0n, new Uint8Array(0));
|
|
expect(result.data.byteLength).toBe(0);
|
|
});
|
|
});
|