Skip to content

Commit 9448c2a

Browse files
Merge pull request #675 from salesforcecli/sm/scratch-org-id
Sm/scratch-org-id
2 parents a4bac3c + 7ba08cd commit 9448c2a

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@oclif/plugin-command-snapshot": "^3.3.14",
19-
"@salesforce/cli-plugins-testkit": "^3.3.5",
19+
"@salesforce/cli-plugins-testkit": "^3.3.6",
2020
"@salesforce/dev-config": "^3.1.0",
2121
"@salesforce/dev-scripts": "^4.3.1",
2222
"@salesforce/plugin-command-reference": "^2.4.4",
@@ -234,4 +234,4 @@
234234
"output": []
235235
}
236236
}
237-
}
237+
}

src/commands/org/create/scratch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default class EnvCreateScratch extends SfCommand<ScratchCreateResponse> {
190190
this.logSuccess(messages.getMessage('success'));
191191
}
192192

193-
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo.Id };
193+
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
194194
} catch (error) {
195195
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
196196
this.spinner.stop(lastStatus);

src/commands/org/resume/scratch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ export default class EnvResumeScratch extends SfCommand<ScratchCreateResponse> {
7070

7171
this.log();
7272
this.logSuccess(messages.getMessage('success'));
73-
return { username, scratchOrgInfo, authFields, warnings, orgId: scratchOrgInfo?.Id };
73+
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
7474
}
7575
}

test/nut/async-create-resume.nut.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ describe('env:create:scratch async/resume', () => {
2121
let soiId: string;
2222
let username: string;
2323

24-
const asyncKeys = ['username', 'orgId', 'scratchOrgInfo', 'warnings'];
25-
const completeKeys = [...asyncKeys, 'authFields'];
24+
const asyncKeys = ['username', 'scratchOrgInfo', 'warnings'];
25+
const completeKeys = [...asyncKeys, 'authFields', 'orgId'];
2626

2727
const readCacheFile = async (): Promise<Record<string, CachedOptions>> =>
2828
JSON.parse(await fs.promises.readFile(cacheFilePath, 'utf8')) as unknown as Record<string, CachedOptions>;
@@ -74,6 +74,7 @@ describe('env:create:scratch async/resume', () => {
7474
if (resp.status === 0) {
7575
done = true;
7676
expect(resp.result).to.have.all.keys(completeKeys);
77+
expect(resp.result.orgId).to.match(/^00D.{15}/);
7778
} else if (resp.name === 'StillInProgressError') {
7879
// eslint-disable-next-line no-await-in-loop
7980
await sleep(Duration.seconds(30));

test/nut/scratchCreate.nut.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ describe('env create scratch NUTs', () => {
6969
}).jsonOutput?.result;
7070
expect(resp).to.have.all.keys(keys);
7171
assert(resp?.username);
72+
expect(resp?.orgId).to.match(/^00D.{15}/);
7273
const stateAggregator = await StateAggregator.create();
7374
expect(await stateAggregator.orgs.read(resp.username)).to.have.property('tracksSource', true);
7475
StateAggregator.clearInstance();
@@ -81,6 +82,7 @@ describe('env create scratch NUTs', () => {
8182
}
8283
).jsonOutput?.result;
8384
expect(resp).to.have.all.keys(keys);
85+
expect(resp?.orgId).to.match(/^00D.{15}/);
8486
});
8587
it('creates an org from config file with "override" flags ', () => {
8688
const expectedUsername = genUniqueString('%[email protected]');

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -901,10 +901,10 @@
901901
mv "~2"
902902
safe-json-stringify "~1"
903903

904-
"@salesforce/cli-plugins-testkit@^3.3.5":
905-
version "3.3.5"
906-
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.3.5.tgz#72866456936f013446cb406129a9fef4fa32fe3e"
907-
integrity sha512-aFNYYqXnXwAwSJ4LtQm0f2XJFurIeZtQguWzQ+1+CV3heoO7z2rQUHTNU+Uknu2JxSF47HEpPthx8v6LEfKk+g==
904+
"@salesforce/cli-plugins-testkit@^3.3.6":
905+
version "3.3.6"
906+
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.3.6.tgz#89c17e87a58e1d0bd6006b65568a6883a17e7e5b"
907+
integrity sha512-40o363ISrdX1FNyt0YLBouQMMMySXS0YLhozTqSjtZDHZn/9gfcVH1LOz9XsOUd1C4SwnVnVjHH2bdVfHzxRWA==
908908
dependencies:
909909
"@salesforce/core" "^3.34.8"
910910
"@salesforce/kit" "^1.9.2"

0 commit comments

Comments
 (0)