Skip to content

Commit cf2c1c6

Browse files
authored
Merge pull request #358 from salesforcecli/cd/org-create-duration-default
fix: set scratch org duration to 7days by default
2 parents 8374fdc + 2a47f14 commit cf2c1c6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/commands/force/org/beta/create.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export class Create extends SfdxCommand {
9090
description: messages.getMessage('flags.durationDays'),
9191
min: 1,
9292
max: 30,
93+
default: 7,
9394
}),
9495
retry: flags.number({
9596
hidden: true,

test/commands/force/org/sandboxCreate.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('org:create', () => {
8989
it('will warn the user when --clientid is passed', async () => {
9090
const commmand = await createCommand(['--type', 'sandbox', '--clientid', '123', '-u', 'testProdOrg']);
9191
await commmand.runIt();
92-
expect(uxWarnStub.calledOnce).to.be.true;
92+
expect(uxWarnStub.calledTwice).to.be.true;
9393
expect(uxWarnStub.firstCall.args[0]).to.equal(
9494
'-i | --clientid is not supported for the sandbox org create command. Its value, 123, has been ignored.'
9595
);
@@ -99,7 +99,7 @@ describe('org:create', () => {
9999
it('will warn the user when --nonamespace is passed', async () => {
100100
const commmand = await createCommand(['--type', 'sandbox', '--nonamespace', '-u', 'testProdOrg']);
101101
await commmand.runIt();
102-
expect(uxWarnStub.calledOnce).to.be.true;
102+
expect(uxWarnStub.calledTwice).to.be.true;
103103
expect(uxWarnStub.firstCall.args[0]).to.equal(
104104
'-n | --nonamespace is not supported for the sandbox org create command. Its value, true, has been ignored.'
105105
);
@@ -108,7 +108,7 @@ describe('org:create', () => {
108108
it('will warn the user when --noancestors is passed', async () => {
109109
const commmand = await createCommand(['--type', 'sandbox', '--noancestors', '-u', 'testProdOrg']);
110110
await commmand.runIt();
111-
expect(uxWarnStub.calledOnce).to.be.true;
111+
expect(uxWarnStub.calledTwice).to.be.true;
112112
expect(uxWarnStub.firstCall.args[0]).to.equal(
113113
'-c | --noancestors is not supported for the sandbox org create command. Its value, true, has been ignored.'
114114
);

test/commands/force/org/scratchOrgCreate.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('org:create', () => {
111111
apiversion: undefined,
112112
clientSecret: undefined,
113113
connectedAppConsumerKey: undefined,
114-
durationDays: undefined,
114+
durationDays: 7,
115115
noancestors: undefined,
116116
nonamespace: undefined,
117117
wait: {
@@ -167,7 +167,7 @@ describe('org:create', () => {
167167
clientSecret,
168168
connectedAppConsumerKey,
169169
definitionfile,
170-
durationDays: undefined,
170+
durationDays: 7,
171171
noancestors: undefined,
172172
nonamespace: undefined,
173173
wait: {
@@ -212,7 +212,7 @@ describe('org:create', () => {
212212
clientSecret: undefined,
213213
connectedAppConsumerKey: undefined,
214214
definitionfile,
215-
durationDays: undefined,
215+
durationDays: 7,
216216
noancestors: undefined,
217217
nonamespace: undefined,
218218
wait: {
@@ -254,7 +254,7 @@ describe('org:create', () => {
254254
clientSecret: undefined,
255255
connectedAppConsumerKey: undefined,
256256
definitionfile,
257-
durationDays: undefined,
257+
durationDays: 7,
258258
noancestors: undefined,
259259
nonamespace: undefined,
260260
wait: {
@@ -285,7 +285,7 @@ describe('org:create', () => {
285285
clientSecret: undefined,
286286
connectedAppConsumerKey: undefined,
287287
definitionfile,
288-
durationDays: undefined,
288+
durationDays: 7,
289289
noancestors: undefined,
290290
nonamespace: undefined,
291291
wait: {

0 commit comments

Comments
 (0)