beeeeg update
Some checks failed
Test and deploy staging / staging (push) Has been cancelled

This commit is contained in:
2026-09-23 04:15:10 +00:00
parent 487eff5bb2
commit d0c7b6548b
135 changed files with 9531 additions and 1777 deletions

20
src/lib/title.test.ts Normal file
View File

@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest';
import { formatTitle, getTitle, siteEnvironment } from './title';
describe('site titles', () => {
it('uses one suffix and an environment prefix', () => {
expect(getTitle('/', 'DEV')).toBe('(DEV) Home | Stan Runge');
expect(getTitle('/projects/catch-em-all', 'STAGING')).toBe('(STAGING) Catchemall | Stan Runge');
expect(formatTitle('A blog post')).toBe('A blog post | Stan Runge');
});
it('gives unlisted routes a readable title', () => {
expect(getTitle('/projects/typing-practice')).toBe('typing practice | Stan Runge');
});
it('labels development and staging without labelling production', () => {
expect(siteEnvironment(true, 'https://staging.stanrunge.dev')).toBe('DEV');
expect(siteEnvironment(false, 'https://staging.stanrunge.dev')).toBe('STAGING');
expect(siteEnvironment(false, 'https://stanrunge.dev')).toBeNull();
});
});