@salesforce/cli-plugins-testkit 2.1.0 → 2.1.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.
- package/CHANGELOG.md +14 -0
- package/lib/hubAuth.js +4 -0
- package/lib/testSession.js +4 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.1.3](https://github.com/salesforcecli/cli-plugins-testkit/compare/v2.1.2...v2.1.3) (2022-06-06)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- globalinfo -> stateAggregator ([6638739](https://github.com/salesforcecli/cli-plugins-testkit/commit/66387396d6aba5276cbadeb2d40fcc98182cd034))
|
|
10
|
+
|
|
11
|
+
### [2.1.2](https://github.com/salesforcecli/cli-plugins-testkit/compare/v2.1.1...v2.1.2) (2022-06-02)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- clear globalInfo instance after every possible touchpoint ([ca7dc01](https://github.com/salesforcecli/cli-plugins-testkit/commit/ca7dc012496ec207649e0ef48a6d1fef2ec94f8d))
|
|
16
|
+
|
|
17
|
+
### [2.1.1](https://github.com/salesforcecli/cli-plugins-testkit/compare/v2.1.0...v2.1.1) (2022-06-02)
|
|
18
|
+
|
|
5
19
|
## [2.1.0](https://github.com/salesforcecli/cli-plugins-testkit/compare/v2.0.1...v2.1.0) (2022-06-01)
|
|
6
20
|
|
|
7
21
|
### Features
|
package/lib/hubAuth.js
CHANGED
|
@@ -12,6 +12,7 @@ const os = require("os");
|
|
|
12
12
|
const fs = require("fs");
|
|
13
13
|
const shell = require("shelljs");
|
|
14
14
|
const debug_1 = require("debug");
|
|
15
|
+
const core_1 = require("@salesforce/core");
|
|
15
16
|
const kit_1 = require("@salesforce/kit");
|
|
16
17
|
// this seems to be a known eslint error for enums
|
|
17
18
|
// eslint-disable-next-line no-shadow
|
|
@@ -86,6 +87,7 @@ const testkitHubAuth = (homeDir, authStrategy = getAuthStrategy()) => {
|
|
|
86
87
|
logger('trying jwt auth');
|
|
87
88
|
const jwtKey = (0, exports.prepareForJwt)(homeDir);
|
|
88
89
|
const results = shell.exec(`sfdx auth:jwt:grant -d -u ${kit_1.env.getString('TESTKIT_HUB_USERNAME', '')} -i ${kit_1.env.getString('TESTKIT_JWT_CLIENT_ID', '')} -f ${jwtKey} -r ${kit_1.env.getString('TESTKIT_HUB_INSTANCE', DEFAULT_INSTANCE_URL)}`, execOpts);
|
|
90
|
+
core_1.StateAggregator.clearInstance();
|
|
89
91
|
if (results.code !== 0) {
|
|
90
92
|
throw new Error(`jwt:grant for org ${kit_1.env.getString('TESTKIT_HUB_USERNAME', 'TESTKIT_HUB_USERNAME was not set')} failed with exit code: ${results.code}\n ${results.stdout + results.stderr}`);
|
|
91
93
|
}
|
|
@@ -95,6 +97,7 @@ const testkitHubAuth = (homeDir, authStrategy = getAuthStrategy()) => {
|
|
|
95
97
|
logger('trying to authenticate with AuthUrl');
|
|
96
98
|
const tmpUrl = (0, exports.prepareForAuthUrl)(homeDir);
|
|
97
99
|
const shellOutput = shell.exec(`sfdx auth:sfdxurl:store -d -f ${tmpUrl}`, execOpts);
|
|
100
|
+
core_1.StateAggregator.clearInstance();
|
|
98
101
|
logger(shellOutput);
|
|
99
102
|
if (shellOutput.code !== 0) {
|
|
100
103
|
throw new Error(`auth:sfdxurl for url ${tmpUrl} failed with exit code: ${shellOutput.code}\n ${shellOutput.stdout + shellOutput.stderr}`);
|
|
@@ -158,6 +161,7 @@ const transferExistingAuthToEnv = (authStrategy = getAuthStrategy()) => {
|
|
|
158
161
|
// this is an org from web:auth or auth:url. Generate the authUrl and set in the env
|
|
159
162
|
logger('copying variables to env from org:display for AuthUrl');
|
|
160
163
|
const displayContents = JSON.parse(shell.exec(`sfdx force:org:display -u ${devhub} --verbose --json`, execOpts));
|
|
164
|
+
core_1.StateAggregator.clearInstance();
|
|
161
165
|
logger(`found ${displayContents.result.sfdxAuthUrl}`);
|
|
162
166
|
kit_1.env.setString('TESTKIT_AUTH_URL', displayContents.result.sfdxAuthUrl);
|
|
163
167
|
return;
|
package/lib/testSession.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.TestSession = void 0;
|
|
|
10
10
|
const fs = require("fs");
|
|
11
11
|
const path = require("path");
|
|
12
12
|
const debug_1 = require("debug");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
13
14
|
const kit_1 = require("@salesforce/kit");
|
|
14
15
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
16
|
const sinon_1 = require("sinon");
|
|
@@ -182,6 +183,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
|
|
|
182
183
|
}
|
|
183
184
|
this.debug('Deleted org result=', rv.stdout);
|
|
184
185
|
}
|
|
186
|
+
core_1.StateAggregator.clearInstance();
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
async rmSessionDir() {
|
|
@@ -273,6 +275,8 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
|
|
|
273
275
|
await this.sleep(timeout);
|
|
274
276
|
}
|
|
275
277
|
}
|
|
278
|
+
// there may be StateAggregator touches from org:create or other setup commands run
|
|
279
|
+
core_1.StateAggregator.clearInstance();
|
|
276
280
|
}
|
|
277
281
|
async sleep(duration) {
|
|
278
282
|
await (0, kit_1.sleep)(duration);
|
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": "2.1.
|
|
4
|
+
"version": "2.1.3",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"!lib/**/*.map"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@salesforce/core": "^3.19.
|
|
46
|
-
"@salesforce/kit": "^1.5.
|
|
45
|
+
"@salesforce/core": "^3.19.4",
|
|
46
|
+
"@salesforce/kit": "^1.5.42",
|
|
47
47
|
"@salesforce/ts-types": "^1.5.17",
|
|
48
48
|
"archiver": "^5.2.0",
|
|
49
49
|
"debug": "^4.3.1",
|