D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
washeet.softurecs.com
/
node_modules
/
@jimp
/
plugin-fisheye
/
src
/
Filename :
index.test.ts
back
Copy
import { expect, test, describe } from "vitest"; import { makeTestImage } from "@jimp/test-utils"; import { createJimp } from "@jimp/core"; import { methods } from "./index.js"; const Jimp = createJimp({ plugins: [methods] }); describe("Fisheye", () => { test("should create fisheye lens to image", () => { const img = Jimp.fromBitmap( makeTestImage( "0000000000", "0001221000", "0022222200", "0122112210", "0221001220", "0221001220", "0122112210", "0022222200", "0001221000", "0000000000", ), ); expect(img.fisheye()).toMatchSnapshot(); }); test("should create fisheye lens to image with radius", async () => { const imgNormal = Jimp.fromBitmap( makeTestImage( "0000000000", "0000000000", "0000000000", "0000000000", "0001111000", "0001111000", "0000000000", "0000000000", "0000000000", "0000000000", ), ); expect(imgNormal.fisheye({ radius: 1.8 })).toMatchSnapshot(); }); });