Skip to content

Commit

Permalink
fixup tests; clean up environment variables (#1063)
Browse files Browse the repository at this point in the history
* clean up environment variables

* fixup tests
  • Loading branch information
tgummerer committed Jan 9, 2024
1 parent c306886 commit 7be0c6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
18 changes: 3 additions & 15 deletions src/__tests__/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,13 @@ describe('main.login', () => {
});
it('should read self-hosted backend config', async () => {
const cloudUrl = 's3://my_region.aws.com';
await login(cloudUrl, '');
await login(cloudUrl);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('--non-interactive', 'login', cloudUrl);
});
it('should login when an access token is provided', async () => {
const accessToken = 'my_access_token';
await login('', accessToken);
it('should login when no cloud url is provided', async () => {
await login('');
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('--non-interactive', 'login');
});
it('should not login when nothing provided', async () => {
await login('', '');
expect(spy).not.toHaveBeenCalled();
});
it('should login with cloud url when both are specified', async () => {
const cloudLogin = 'my login url';
const accessToken = 'my access token';
await login(cloudLogin, accessToken);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('--non-interactive', 'login', cloudLogin);
});
});
3 changes: 0 additions & 3 deletions src/libs/envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import * as envalid from 'envalid';

export const environmentVariables = envalid.cleanEnv(process.env, {
GITHUB_WORKSPACE: envalid.str(),
PULUMI_ACCESS_TOKEN: envalid.str({
default: '',
}),
});

export type EnvironmentVariables = typeof environmentVariables;

0 comments on commit 7be0c6a

Please sign in to comment.