Skip to content

Commit

Permalink
fix: update test and don't throw when auth file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Mar 23, 2019
1 parent 45195c1 commit 75af396
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/authInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export class AuthInfo extends AsyncCreatable<AuthInfo.Options> {
if (this.options.username && this.options.oauth2Options) {
const authInfoConfig = await AuthInfoConfig.create({
...AuthInfoConfig.getOptions(this.options.username),
throwOnNotFound: true
throwOnNotFound: false
});
if (await authInfoConfig.exists()) {
throw SfdxError.create(
Expand Down
5 changes: 2 additions & 3 deletions test/unit/orgTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { tmpdir as osTmpdir } from 'os';
import { join as pathJoin } from 'path';
import { AuthFields, AuthInfo } from '../../src/authInfo';
import { Aliases } from '../../src/config/aliases';
import { AuthInfoConfig } from '../../src/config/authInfoConfig';
import { Config } from '../../src/config/config';
import { ConfigAggregator } from '../../src/config/configAggregator';
import { ConfigFile } from '../../src/config/configFile';
Expand All @@ -26,7 +27,6 @@ import { Global } from '../../src/global';
import { Org } from '../../src/org';
import { MockTestOrgData, testSetup } from '../../src/testSetup';
import { fs } from '../../src/util/fs';
import { AuthInfoConfig } from '../../src/config/authInfoConfig';

const $$ = testSetup();

Expand Down Expand Up @@ -309,7 +309,7 @@ describe('Org Tests', () => {
});
});

describe.only('with multiple scratch org users', () => {
describe('with multiple scratch org users', () => {
let orgs: Org[];
beforeEach(async () => {
orgs = [];
Expand Down Expand Up @@ -337,7 +337,6 @@ describe('Org Tests', () => {
return Promise.resolve(responseBody);
});

// stubMethod($$.SANDBOX, ConfigFile.prototype, 'read').callsFake(() => Promise.resolve({}));
$$.SANDBOX.stub(AuthInfoConfig.prototype, 'exists').returns(Promise.resolve(false));

for (const user of users) {
Expand Down

0 comments on commit 75af396

Please sign in to comment.