Compare commits

..
Author SHA1 Message Date
Tabish Bidiwale 1933ff8362 fix: set USERPROFILE for Windows compatibility in telemetry tests
On Windows, os.homedir() uses the USERPROFILE environment variable
instead of HOME. The telemetry config tests were only mocking HOME,
causing them to fail on Windows CI.
2026-01-09 23:35:00 -08:00
+3 -6
View File
@@ -50,10 +50,7 @@ program
program.option('--no-color', 'Disable color output');
// Apply global flags and telemetry before any command runs
// Note: preAction receives (thisCommand, actionCommand) where:
// - thisCommand: the command where hook was added (root program)
// - actionCommand: the command actually being executed (subcommand)
program.hook('preAction', async (thisCommand, actionCommand) => {
program.hook('preAction', async (thisCommand) => {
const opts = thisCommand.opts();
if (opts.color === false) {
process.env.NO_COLOR = '1';
@@ -62,8 +59,8 @@ program.hook('preAction', async (thisCommand, actionCommand) => {
// Show first-run telemetry notice (if not seen)
await maybeShowTelemetryNotice();
// Track command execution (use actionCommand to get the actual subcommand)
const commandPath = getCommandPath(actionCommand);
// Track command execution
const commandPath = getCommandPath(thisCommand);
await trackCommand(commandPath, version);
});