Merge pull request #997 from github/aeisenberg/cli-version-test

Avoid testing for the correct CLI_VERSION if CLI_PATH is set
This commit is contained in:
Andrew Eisenberg
2021-11-08 09:37:18 -08:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ describe('Use cli', function() {
}
});
if (process.env.CLI_VERSION !== 'nightly') {
if (process.env.CLI_VERSION && process.env.CLI_VERSION !== 'nightly') {
it('should have the correct version of the cli', async () => {
expect(
(await cli.getVersion()).toString()

View File

@@ -61,6 +61,9 @@ export async function ensureCli(useCli: boolean) {
if ('CLI_PATH' in process.env) {
const executablePath = process.env.CLI_PATH;
console.log(`Using existing CLI at ${executablePath}`);
// The CLI_VERSION env variable is not used when the CLI_PATH is set.
delete process.env.CLI_VERSION;
return;
}