Add initial project files

This commit is contained in:
Igor Martyniuk
2026-09-01 13:03:41 +03:00
parent 22e111bb44
commit 74cb5b6176
1841 changed files with 242819 additions and 30 deletions
+26
View File
@@ -0,0 +1,26 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import robots from '#app/robots';
afterEach(() => {
vi.unstubAllEnvs();
});
describe('robots.txt', () => {
it('lets crawlers in everywhere except preview URLs', () => {
vi.stubEnv('SITE_URL', 'https://crux.example.com');
const result = robots();
expect(result.rules).toEqual({
userAgent: '*',
allow: '/',
disallow: '/*/preview'
});
});
it('advertises the sitemap on the configured origin', () => {
vi.stubEnv('SITE_URL', 'https://crux.example.com');
expect(robots().sitemap).toBe('https://crux.example.com/sitemap.xml');
});
});