Skip to content

Commit f1c7c7d

Browse files
move the check on the ENV variable to force telemetry consent in tests
1 parent 141174d commit f1c7c7d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

v-next/hardhat/src/internal/cli/telemetry/telemetry-permissions.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ export async function isTelemetryAllowed(): Promise<boolean> {
4747
return false;
4848
}
4949

50-
const consent = await getTelemetryConsent();
51-
5250
// ATTENTION: only for testing
5351
if (process.env.HARDHAT_TEST_TELEMETRY_CONSENT_VALUE !== undefined) {
5452
return process.env.HARDHAT_TEST_TELEMETRY_CONSENT_VALUE === "true"
5553
? true
5654
: false;
5755
}
5856

57+
const consent = await getTelemetryConsent();
58+
5959
return consent !== undefined ? consent : false;
6060
}
6161

@@ -72,7 +72,8 @@ export function isTelemetryAllowedInEnvironment(): boolean {
7272
(!isCi() &&
7373
process.stdout.isTTY === true &&
7474
process.env.HARDHAT_DISABLE_TELEMETRY_PROMPT !== "true") ||
75-
process.env.HARDHAT_TEST_INTERACTIVE_ENV === "true" // Used in tests to force telemetry execution
75+
// ATTENTION: used in tests to force telemetry execution
76+
process.env.HARDHAT_TEST_INTERACTIVE_ENV === "true"
7677
);
7778
}
7879

0 commit comments

Comments
 (0)