Files
pbakaus_impeccable/tests/pin.test.mjs
T
Paul Bakaus ddc372427f Fix provider script command rendering
Replace heuristic rewrites across executable scripts with one explicit provider marker, render pinned shortcuts per target harness, and remove the personal email from the public publisher manifest.

Addresses automated review feedback on PR #363.

AI assistance: OpenAI Codex prepared and validated these changes under maintainer direction.
2026-07-09 17:05:38 -07:00

47 lines
1.6 KiB
JavaScript

import { afterEach, beforeEach, describe, it } from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { spawnSync } from 'node:child_process';
const ROOT = process.cwd();
const PIN_SCRIPT = path.join(ROOT, 'skill', 'scripts', 'pin.mjs');
describe('pin command provider syntax', () => {
let project;
beforeEach(() => {
project = fs.mkdtempSync(path.join(os.tmpdir(), 'impeccable-pin-'));
fs.writeFileSync(path.join(project, 'package.json'), '{}\n');
for (const harness of ['.claude', '.cursor', '.agents', '.codex']) {
fs.mkdirSync(path.join(project, harness, 'skills', 'impeccable'), { recursive: true });
}
});
afterEach(() => {
fs.rmSync(project, { recursive: true, force: true });
});
it('renders each pinned shortcut for its target harness', () => {
const result = spawnSync(process.execPath, [PIN_SCRIPT, 'pin', 'audit'], {
cwd: project,
encoding: 'utf8',
});
assert.equal(result.status, 0, result.stderr || result.stdout);
for (const harness of ['.claude', '.cursor']) {
const skill = fs.readFileSync(path.join(project, harness, 'skills', 'audit', 'SKILL.md'), 'utf8');
assert.match(skill, /\/impeccable audit/);
assert.doesNotMatch(skill, /\$impeccable audit/);
}
for (const harness of ['.agents', '.codex']) {
const skill = fs.readFileSync(path.join(project, harness, 'skills', 'audit', 'SKILL.md'), 'utf8');
assert.match(skill, /\$impeccable audit/);
assert.doesNotMatch(skill, /\/impeccable audit/);
}
});
});