fix(claude): implement official hook contract
This commit is contained in:
1 parent
e2d8351f36
commit
e011003680
11 files changed
+1782
-146
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
createFixture,
|
||||
runProcess,
|
||||
} from '../test-support/claudecode-test-helpers.mjs';
|
||||
|
||||
const claudeBinary = process.env.ELYDORA_CLAUDE_BINARY;
|
||||
|
||||
test('official Claude Code accepts the installed user hook contract', {
|
||||
skip: claudeBinary ? false : 'set ELYDORA_CLAUDE_BINARY to the official Claude Code executable',
|
||||
}, async () => {
|
||||
const fixture = await createFixture();
|
||||
try {
|
||||
assert.equal((await fixture.install()).code, 0);
|
||||
const environment = {
|
||||
HOME: fixture.homeDir,
|
||||
USERPROFILE: fixture.homeDir,
|
||||
CLAUDE_CONFIG_DIR: fixture.claudeConfigDir,
|
||||
DISABLE_AUTOUPDATER: '1',
|
||||
DISABLE_TELEMETRY: '1',
|
||||
};
|
||||
const version = await runProcess(
|
||||
claudeBinary,
|
||||
['--version'],
|
||||
environment,
|
||||
fixture.projectDir,
|
||||
);
|
||||
assert.equal(version.code, 0, version.stderr);
|
||||
assert.match(version.stdout, /Claude Code/i);
|
||||
|
||||
const doctor = await runProcess(
|
||||
claudeBinary,
|
||||
['doctor'],
|
||||
environment,
|
||||
fixture.projectDir,
|
||||
);
|
||||
assert.equal(doctor.code, 0, doctor.stderr);
|
||||
const output = `${doctor.stdout}\n${doctor.stderr}`;
|
||||
assert.doesNotMatch(output, /invalid settings|settings validation|failed to parse/i);
|
||||
} finally {
|
||||
await fixture.close();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user