19 lines
923 B
TypeScript
19 lines
923 B
TypeScript
// README badges never go stale: the version comes from npm (a static version badge once said 0.6.0 at 0.8.23) and the
|
|
// skill count must match skills/*/SKILL.md.
|
|
import { describe, expect, test } from 'bun:test';
|
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const root = join(import.meta.dir, '..');
|
|
const readme = readFileSync(join(root, 'README.md'), 'utf8');
|
|
|
|
describe('README badges', () => {
|
|
test('no hand-written version badge; the npm badge is live', () => {
|
|
expect(readme).not.toMatch(/img\.shields\.io\/badge\/version-/);
|
|
expect(readme).toContain('img.shields.io/npm/v/storebound');
|
|
});
|
|
test('the Agent Skills badge counts every skill', () => {
|
|
const n = readdirSync(join(root, 'skills')).filter(d => existsSync(join(root, 'skills', d, 'SKILL.md'))).length;
|
|
expect(/Agent%20Skills-(\d+)-/.exec(readme)?.[1]).toBe(String(n));
|
|
});
|
|
});
|