Skip to content

Commit 6b469ea

Browse files
committed
fix: test and snapshot updates
1 parent 78186ed commit 6b469ea

File tree

5 files changed

+79
-91
lines changed

5 files changed

+79
-91
lines changed

command-snapshot.json

Lines changed: 71 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,72 @@
11
[
2-
{
3-
"command": "force:org:beta:create",
4-
"plugin": "@salesforce/plugin-org",
5-
"flags": [
6-
"apiversion",
7-
"clientid",
8-
"definitionfile",
9-
"durationdays",
10-
"json",
11-
"loglevel",
12-
"noancestors",
13-
"nonamespace",
14-
"retry",
15-
"setalias",
16-
"setdefaultusername",
17-
"targetdevhubusername",
18-
"targetusername",
19-
"type",
20-
"wait"
21-
]
22-
},
23-
{
24-
"command": "force:org:delete",
25-
"plugin": "@salesforce/plugin-org",
26-
"flags": [
27-
"apiversion",
28-
"json",
29-
"loglevel",
30-
"noprompt",
31-
"targetdevhubusername",
32-
"targetusername"
33-
]
34-
},
35-
{
36-
"command": "force:org:display",
37-
"plugin": "@salesforce/plugin-org",
38-
"flags": [
39-
"apiversion",
40-
"json",
41-
"loglevel",
42-
"targetusername",
43-
"verbose"
44-
]
45-
},
46-
{
47-
"command": "force:org:list",
48-
"plugin": "@salesforce/plugin-org",
49-
"flags": [
50-
"all",
51-
"clean",
52-
"json",
53-
"loglevel",
54-
"noprompt",
55-
"skipconnectionstatus",
56-
"verbose"
57-
]
58-
},
59-
{
60-
"command": "force:org:open",
61-
"plugin": "@salesforce/plugin-org",
62-
"flags": [
63-
"apiversion",
64-
"browser",
65-
"json",
66-
"loglevel",
67-
"path",
68-
"targetusername",
69-
"urlonly"
70-
]
71-
},
72-
{
73-
"command": "force:org:status",
74-
"plugin": "@salesforce/plugin-org",
75-
"flags": [
76-
"apiversion",
77-
"json",
78-
"loglevel",
79-
"sandboxname",
80-
"setalias",
81-
"setdefaultusername",
82-
"targetusername",
83-
"wait"
84-
]
85-
}
86-
]
2+
{
3+
"command": "force:org:beta:create",
4+
"plugin": "@salesforce/plugin-org",
5+
"flags": [
6+
"apiversion",
7+
"clientid",
8+
"definitionfile",
9+
"durationdays",
10+
"json",
11+
"loglevel",
12+
"noancestors",
13+
"nonamespace",
14+
"retry",
15+
"setalias",
16+
"setdefaultusername",
17+
"targetdevhubusername",
18+
"targetusername",
19+
"type",
20+
"wait"
21+
]
22+
},
23+
{
24+
"command": "force:org:delete",
25+
"plugin": "@salesforce/plugin-org",
26+
"flags": ["apiversion", "json", "loglevel", "noprompt", "targetdevhubusername", "targetusername"]
27+
},
28+
{
29+
"command": "force:org:display",
30+
"plugin": "@salesforce/plugin-org",
31+
"flags": ["apiversion", "json", "loglevel", "targetusername", "verbose"]
32+
},
33+
{
34+
"command": "force:org:list",
35+
"plugin": "@salesforce/plugin-org",
36+
"flags": ["all", "clean", "json", "loglevel", "noprompt", "skipconnectionstatus", "verbose"]
37+
},
38+
{
39+
"command": "force:org:open",
40+
"plugin": "@salesforce/plugin-org",
41+
"flags": ["apiversion", "browser", "json", "loglevel", "path", "targetusername", "urlonly"]
42+
},
43+
{
44+
"command": "force:org:status",
45+
"plugin": "@salesforce/plugin-org",
46+
"flags": [
47+
"apiversion",
48+
"json",
49+
"loglevel",
50+
"sandboxname",
51+
"setalias",
52+
"setdefaultusername",
53+
"targetusername",
54+
"wait"
55+
]
56+
},
57+
{
58+
"command": "force:org:clone",
59+
"plugin": "@salesforce/plugin-org",
60+
"flags": [
61+
"apiversion",
62+
"json",
63+
"loglevel",
64+
"type",
65+
"definitionfile",
66+
"setalias",
67+
"setdefaultusername",
68+
"targetusername",
69+
"wait"
70+
]
71+
}
72+
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959
},
6060
"engines": {
61-
"node": ">=12.0.0"
61+
"node": ">=14.0.0"
6262
},
6363
"files": [
6464
"/lib",

test/commands/force/org/list.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77
import { expect, test } from '@salesforce/command/lib/test';
8+
import { UX } from '@salesforce/command';
89
import * as chai from 'chai';
910
import * as sinon from 'sinon';
1011
import * as chaiAsPromised from 'chai-as-promised';
11-
import cli from 'cli-ux';
1212

1313
chai.use(chaiAsPromised);
1414

@@ -71,22 +71,21 @@ describe('org_list', () => {
7171
stubMethod(sandbox, Connection, 'create').resolves({});
7272
stubMethod(sandbox, AuthInfo, 'create').resolves(async () => authInfoStub);
7373
stubMethod(sandbox, Org, 'create').resolves(Org.prototype);
74+
stubMethod(sandbox, UX.prototype, 'confirm').resolves(false);
7475
spies.set('orgRemove', stubMethod(sandbox, Org.prototype, 'remove').resolves());
7576
});
7677

7778
test
78-
.stub(cli, 'confirm', () => async () => false)
7979
.stdout()
8080
.command(['force:org:list', '--json', '--clean'])
8181
.it('not cleaned after confirmation false', async () => {
8282
expect(spies.get('orgRemove').callCount).to.equal(0);
8383
});
8484

8585
test
86-
.stub(cli, 'confirm', () => async () => true)
8786
.stdout()
88-
.command(['force:org:list', '--json', '--clean'])
89-
.it('cleaned after confirmation true', async () => {
87+
.command(['force:org:list', '--json', '--clean', '--noprompt'])
88+
.it('cleans 2 orgs', async () => {
9089
expect(spies.get('orgRemove').callCount).to.equal(2); // there are 2 expired scratch orgs
9190
});
9291
});

test/commands/force/org/open.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ describe('open commands', () => {
238238
spies.set('resolver', stubMethod(sandbox, MyDomainResolver.prototype, 'resolve').resolves('1.1.1.1'));
239239
})
240240
.stdout()
241+
.stderr()
241242
.command(['force:org:open', '--targetusername', username, '--path', testPath, '-b', 'duff'])
242243
.it('does not call open as passed unknown browser name', () => {
243244
expect(spies.get('resolver').callCount).to.equal(0);

test/commands/force/org/status.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ describe('org:status', () => {
9393
on: onStub,
9494
});
9595
uxTableStub = stubMethod(sandbox, UX.prototype, 'table');
96+
stubMethod(sandbox, UX.prototype, 'log');
97+
stubMethod(sandbox, UX.prototype, 'styledHeader');
9698
updateValueStub = stubMethod(sandbox, Aliases.prototype, 'updateValue');
9799
return cmd.runIt();
98100
};

0 commit comments

Comments
 (0)