mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-08 09:05:53 +00:00
test(hooks): isolate the no-deps session-start test from NODE_PATH and the context cap
A NODE_PATH that exposes js-yaml let the regression pass the test, and an inherited ECC_SESSION_START_MAX_CHARS=0 made it fail falsely. Drop NODE_PATH from the child environment and pin the cap to 8000, as session-start-alias-unavailable.test.js does.
This commit is contained in:
1 parent
1d704e75e3
commit
218f4ae85f
1 file changed
+8
-3
@@ -121,11 +121,16 @@ function runTests() {
|
||||
fs.mkdirSync(data, { recursive: true });
|
||||
fs.writeFileSync(path.join(project, 'pubspec.yaml'), 'name: app\ndependencies:\n flutter:\n sdk: flutter\n');
|
||||
|
||||
const env = { ...process.env, HOME: home, USERPROFILE: home, ECC_AGENT_DATA_HOME: data,
|
||||
CLAUDE_CONFIG_DIR: data, CLAUDE_PROJECT_DIR: project, XDG_DATA_HOME: path.join(home, '.local', 'share'),
|
||||
ECC_HOMUNCULUS_DIR: path.join(data, 'homunculus'), ECC_SESSION_START_CONTEXT: 'true',
|
||||
ECC_SESSION_START_MAX_CHARS: '8000' };
|
||||
// A NODE_PATH that exposes js-yaml would hide the missing dependency.
|
||||
delete env.NODE_PATH;
|
||||
|
||||
const result = spawnSync(process.execPath, [path.join(pluginDir, 'scripts', 'hooks', 'session-start.js')], {
|
||||
cwd: project,
|
||||
env: { ...process.env, HOME: home, USERPROFILE: home, ECC_AGENT_DATA_HOME: data,
|
||||
CLAUDE_CONFIG_DIR: data, CLAUDE_PROJECT_DIR: project, XDG_DATA_HOME: path.join(home, '.local', 'share'),
|
||||
ECC_HOMUNCULUS_DIR: path.join(data, 'homunculus'), ECC_SESSION_START_CONTEXT: 'true' },
|
||||
env,
|
||||
input: JSON.stringify({ hook_event_name: 'SessionStart', source: 'startup', session_id: 'no-deps', cwd: project }),
|
||||
encoding: 'utf8',
|
||||
timeout: 15000,
|
||||
|
||||
Reference in new issue
Block a user