mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
12 lines
475 B
TypeScript
12 lines
475 B
TypeScript
import { getCaptchaImages } from './assets.ts';
|
|
import { generateCaptcha, verifyCaptchaSolution } from './captcha.ts';
|
|
|
|
Deno.test('generateCaptcha', async () => {
|
|
const images = await getCaptchaImages();
|
|
generateCaptcha(images, { w: 370, h: 400 }, { w: 65, h: 65 });
|
|
});
|
|
|
|
Deno.test('verifyCaptchaSolution', () => {
|
|
verifyCaptchaSolution({ w: 65, h: 65 }, { x: 0, y: 0 }, { x: 0, y: 0 });
|
|
verifyCaptchaSolution({ w: 65, h: 65 }, { x: 0, y: 0 }, { x: 10, y: 10 });
|
|
});
|