@salesforce/cli-plugins-testkit 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,6 +80,7 @@ export declare class TestSession extends AsyncOptionalCreatable<TestSessionOptio
80
80
  private zipDir;
81
81
  private options;
82
82
  private shelljsExecOptions;
83
+ private orgsAliases;
83
84
  constructor(options?: TestSessionOptions);
84
85
  /**
85
86
  * Get an existing test session created with the same options,
@@ -54,6 +54,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
54
54
  this.shelljsExecOptions = {
55
55
  silent: true,
56
56
  };
57
+ this.orgsAliases = ['default'];
57
58
  this.options = options;
58
59
  this.debug = (0, debug_1.debug)('testkit:session');
59
60
  this.zipDir = zip_1.zipDir;
@@ -167,7 +168,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
167
168
  async deleteOrgs() {
168
169
  if (!kit_1.env.getString('TESTKIT_ORG_USERNAME') && this.orgs.size > 0) {
169
170
  for (const org of [...this.orgs.keys()]) {
170
- if (org === 'default')
171
+ if (this.orgsAliases.includes(org))
171
172
  continue;
172
173
  this.debug(`Deleting test org: ${org}`);
173
174
  const rv = shell.exec(`sf env delete scratch -o ${org} -p`, this.shelljsExecOptions);
@@ -245,6 +246,10 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
245
246
  if (org.setDefault) {
246
247
  this.orgs.set('default', jsonOutput.result.authFields);
247
248
  }
249
+ if (org.alias) {
250
+ this.orgsAliases.push(org.alias);
251
+ this.orgs.set(org.alias, jsonOutput.result.authFields);
252
+ }
248
253
  }
249
254
  };
250
255
  let attempts = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/cli-plugins-testkit",
3
3
  "description": "Provides test utilities to assist Salesforce CLI plug-in authors with writing non-unit tests (NUT).",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "author": "Salesforce",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "lib/index.js",