generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: more scratch org creation flags (#641)
* feat: more scratch org creation flags * fix: edit messages for new flags * feat: edition overrides definition file, both are allowed * test: allow edition with config file * test: remove unused test dep --------- Co-authored-by: Juliet Shackell <[email protected]>
- Loading branch information
1 parent
c133036
commit c09d229
Showing
5 changed files
with
86 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,4 +234,4 @@ | |
"output": [] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
*/ | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; | ||
import { execCmd, genUniqueString, TestSession } from '@salesforce/cli-plugins-testkit'; | ||
import { assert, expect } from 'chai'; | ||
import { AuthFields, Messages, Global, StateAggregator } from '@salesforce/core'; | ||
import { secretTimeout } from '../../src/commands/org/create/scratch'; | ||
|
@@ -42,9 +42,6 @@ describe('env create scratch NUTs', () => { | |
it('non-existent config file', () => { | ||
execCmd('env:create:scratch -f badfile.json', { ensureExitCode: 1 }); | ||
}); | ||
it('config file AND edition', () => { | ||
execCmd('env:create:scratch -f config/project-scratch-def.json --edition developer', { ensureExitCode: 1 }); | ||
}); | ||
it('wait zero', () => { | ||
execCmd('env:create:scratch -f config/project-scratch-def.json --wait 0', { ensureExitCode: 1 }); | ||
}); | ||
|
@@ -85,6 +82,17 @@ describe('env create scratch NUTs', () => { | |
).jsonOutput?.result; | ||
expect(resp).to.have.all.keys(keys); | ||
}); | ||
it('creates an org from config file with "override" flags ', () => { | ||
const expectedUsername = genUniqueString('%[email protected]'); | ||
const resp = execCmd<ScratchCreateResponse>( | ||
`env:create:scratch -f config/project-scratch-def.json --json --username ${expectedUsername} --description "new one" --name TheOrg --wait 60`, | ||
{ | ||
ensureExitCode: 0, | ||
} | ||
).jsonOutput?.result; | ||
expect(resp).to.have.all.keys(keys); | ||
expect(resp?.username).to.equal(expectedUsername); | ||
}); | ||
it('creates an org with tracking disabled ', async () => { | ||
const resp = execCmd<ScratchCreateResponse>( | ||
'env:create:scratch --edition developer --no-track-source --json --wait 60', | ||
|