Files
pbakaus_impeccable/tests/lib/detector-bundle.test.js
T
Paul BakausandClaude Opus 4.8 f7f2bfc800 feat(detector): deprecate --fast (now a no-op, full scan always)
Since the jsdom removal the static HTML/CSS analysis is fast (~4ms/file) and
covers every rule, so the regex-only `--fast` path only loses coverage (it
ran ~10 of 41 rules) for no real speed win. It's a foot-gun: a `--fast` scan
can read "clean" because most rules silently don't run.

Deprecate gracefully rather than hard-remove: the flag is still accepted (so
existing CI scripts don't break) but ignored, with a one-line stderr notice,
and the full scan always runs. Dropped from --help and the example. Removed
the `--fast` suggestion from the many-files warning and from critique.md's
scan guidance.

Ships to users via a CLI release (npm) and rides the next skill release in
the bundled detector. Tests updated to assert the deprecation behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 15:50:53 -07:00

28 lines
1.1 KiB
JavaScript

import { describe, expect, test } from 'bun:test';
import fs from 'fs';
import path from 'path';
import { readSourceFiles } from '../../scripts/lib/utils.js';
const ROOT = process.cwd();
describe('skill detector bundle', () => {
test('adds the detector wrapper and engine files to skill scripts', () => {
const { skills } = readSourceFiles(ROOT);
const skill = skills.find(s => s.name === 'impeccable');
const scriptNames = new Set(skill.scripts.map(s => s.name));
expect(scriptNames.has('detect.mjs')).toBe(true);
expect(scriptNames.has('detector/detect-antipatterns.mjs')).toBe(true);
expect(scriptNames.has('detector/detect-antipatterns-browser.js')).toBe(true);
expect(scriptNames.has('detector/cli/main.mjs')).toBe(true);
expect(scriptNames.has('detector/engines/static-html/detect-html.mjs')).toBe(true);
});
test('critique references the bundled detector command', () => {
const critique = fs.readFileSync(path.join(ROOT, 'skill/reference/critique.md'), 'utf-8');
expect(critique).toContain('node {{scripts_path}}/detect.mjs --json [target]');
expect(critique).not.toContain('npx impeccable detect');
});
});