fix: harden windows CI tests and markdown lint

This commit is contained in:
Affaan Mustafa
2026-03-20 03:03:57 -07:00
parent cbccb7fdc0
commit e70c43bcd4
6 changed files with 51 additions and 20 deletions

View File

@@ -50,6 +50,15 @@ function setupPluginCache(homeDir, orgName, version) {
return cacheDir;
}
function withHomeEnv(homeDir, extraEnv = {}) {
return {
PATH: process.env.PATH,
HOME: homeDir,
USERPROFILE: homeDir,
...extraEnv,
};
}
function runTests() {
console.log('\n=== Testing resolve-ecc-root.js ===\n');
@@ -215,7 +224,7 @@ function runTests() {
const result = execFileSync('node', [
'-e', `console.log(${INLINE_RESOLVE})`,
], {
env: { PATH: process.env.PATH, HOME: homeDir },
env: withHomeEnv(homeDir),
encoding: 'utf8',
}).trim();
assert.strictEqual(result, expected);
@@ -231,7 +240,7 @@ function runTests() {
const result = execFileSync('node', [
'-e', `console.log(${INLINE_RESOLVE})`,
], {
env: { PATH: process.env.PATH, HOME: homeDir },
env: withHomeEnv(homeDir),
encoding: 'utf8',
}).trim();
assert.strictEqual(result, path.join(homeDir, '.claude'));