@salesforce/cli-plugins-testkit 3.2.22 → 3.2.23
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/lib/hubAuth.js +3 -3
- package/lib/testSession.js +3 -3
- package/package.json +2 -2
package/lib/hubAuth.js
CHANGED
|
@@ -76,7 +76,7 @@ const testkitHubAuth = (homeDir, authStrategy = (0, exports.getAuthStrategy)())
|
|
|
76
76
|
if (authStrategy === 'JWT') {
|
|
77
77
|
logger('trying jwt auth');
|
|
78
78
|
const jwtKey = (0, exports.prepareForJwt)(homeDir);
|
|
79
|
-
const results = shell.exec(`sf login
|
|
79
|
+
const results = shell.exec(`sf org:login:jwt --set-default-dev-hub --username ${kit_1.env.getString('TESTKIT_HUB_USERNAME', '')} --client-id ${kit_1.env.getString('TESTKIT_JWT_CLIENT_ID', '')} --jwt-key-file ${jwtKey} --instance-url ${kit_1.env.getString('TESTKIT_HUB_INSTANCE', DEFAULT_INSTANCE_URL)}`, execOpts);
|
|
80
80
|
if (results.code !== 0) {
|
|
81
81
|
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}`);
|
|
82
82
|
}
|
|
@@ -85,10 +85,10 @@ const testkitHubAuth = (homeDir, authStrategy = (0, exports.getAuthStrategy)())
|
|
|
85
85
|
if (authStrategy === 'AUTH_URL') {
|
|
86
86
|
logger('trying to authenticate with AuthUrl');
|
|
87
87
|
const tmpUrl = (0, exports.prepareForAuthUrl)(homeDir);
|
|
88
|
-
const shellOutput = shell.exec(`
|
|
88
|
+
const shellOutput = shell.exec(`sf org:login:sfdx-url -d -f ${tmpUrl}`, execOpts);
|
|
89
89
|
logger(shellOutput);
|
|
90
90
|
if (shellOutput.code !== 0) {
|
|
91
|
-
throw new Error(`
|
|
91
|
+
throw new Error(`org:login:sfdx-ur for url ${tmpUrl} failed with exit code: ${shellOutput.code}\n ${shellOutput.stdout + shellOutput.stderr}`);
|
|
92
92
|
}
|
|
93
93
|
return;
|
|
94
94
|
}
|
package/lib/testSession.js
CHANGED
|
@@ -101,7 +101,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
|
|
|
101
101
|
const configResults = JSON.parse(stripAnsi(config.stdout));
|
|
102
102
|
const usernameOrAlias = configResults.result.find((org) => org.name === 'target-dev-hub')?.value;
|
|
103
103
|
if (usernameOrAlias) {
|
|
104
|
-
const displayEnv = shell.exec(`sf
|
|
104
|
+
const displayEnv = shell.exec(`sf org:display -o ${usernameOrAlias} --json`, this.shelljsExecOptions);
|
|
105
105
|
const displayEnvResults = JSON.parse(stripAnsi(displayEnv.stdout));
|
|
106
106
|
this.hubOrg = displayEnvResults.result;
|
|
107
107
|
}
|
|
@@ -183,7 +183,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
|
|
|
183
183
|
if (this.orgsAliases.includes(org))
|
|
184
184
|
continue;
|
|
185
185
|
this.debug(`Deleting test org: ${org}`);
|
|
186
|
-
const rv = shell.exec(`sf
|
|
186
|
+
const rv = shell.exec(`sf org:delete:scratch -o ${org} -p`, this.shelljsExecOptions);
|
|
187
187
|
this.orgs.delete(org);
|
|
188
188
|
if (rv.code !== 0) {
|
|
189
189
|
// Must still delete the session dir if org:delete fails
|
|
@@ -239,7 +239,7 @@ class TestSession extends kit_1.AsyncOptionalCreatable {
|
|
|
239
239
|
if (org.executable === 'sfdx')
|
|
240
240
|
baseCmd += ` username=${org.username}`;
|
|
241
241
|
else
|
|
242
|
-
throw new Error('username property is not supported by sf
|
|
242
|
+
throw new Error('username property is not supported by sf org create scratch');
|
|
243
243
|
}
|
|
244
244
|
if (org.edition) {
|
|
245
245
|
baseCmd += executable === 'sf' ? ` -e ${org.edition}` : ` edition=${org.edition}`;
|
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.2.
|
|
4
|
+
"version": "3.2.23",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@types/archiver": "^5.1.0",
|
|
61
61
|
"@types/debug": "^4.1.5",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
63
|
-
"@typescript-eslint/parser": "^5.
|
|
63
|
+
"@typescript-eslint/parser": "^5.53.0",
|
|
64
64
|
"chai": "^4.3.7",
|
|
65
65
|
"eslint": "^8.34.0",
|
|
66
66
|
"eslint-config-prettier": "^8.6.0",
|