19 lines
432 B
TypeScript
19 lines
432 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { Fico } from "../src/Fico.js";
|
|
|
|
describe("read png", () => {
|
|
it("should read PNG and recover original data", () => {
|
|
const fico = new Fico();
|
|
|
|
const input = new TextEncoder().encode("Hello FICO 🚀");
|
|
|
|
// encode → PNG
|
|
const png = fico.toPNG(input);
|
|
|
|
// PNG → decode
|
|
const output = fico.fromPNG(png);
|
|
|
|
expect(output).toEqual(input);
|
|
});
|
|
});
|