@fairfetch/fair-fetch
Version:
Protect your site from AI scrapers by adding invisible noise to your site which confuses AI bots while keeping your site looking and functioning normally for your human visitors.
15 lines (14 loc) • 552 B
JavaScript
import { BotAgent } from '../../types/BotAgent';
import { BotValidator } from './BotValidator';
describe('BotValidator', () => {
describe('isValid()', () => {
it('should validate GoogleBot IPs', async () => {
const headers = new Headers({
'User-Agent': BotAgent.GoogleBot.toString(),
});
const validator = new BotValidator(headers, '2001:4860:4801:1c::/64');
await validator.loadIpRanges();
expect(await validator.isValid()).toEqual(true);
});
});
});