generated from salesforcecli/plugin-template-sf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #759 from salesforcecli/mdonnalley/new-table
feat: use new table
- Loading branch information
Showing
7 changed files
with
351 additions
and
190 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
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ describe('alias list NUTs', () => { | |
}); | ||
|
||
it('lists no aliases stdout', () => { | ||
const res: string = execCmd('alias list').shellOutput; | ||
const res = execCmd('alias list').shellOutput; | ||
expect(res).to.include('No results'); | ||
}); | ||
}); | ||
|
@@ -60,10 +60,13 @@ describe('alias list NUTs', () => { | |
}); | ||
|
||
it('lists singular result correctly stdout', () => { | ||
const res: string = execCmd('alias list', { ensureExitCode: 0 }).shellOutput; | ||
expect(res).to.include('Alias List\n====='); // Table header | ||
expect(res).to.include('Alias Value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
const res = execCmd('alias list', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
expect(res).to.include('Alias List'); // Table header | ||
expect(res).to.include('alias value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
}); | ||
}); | ||
|
||
|
@@ -94,12 +97,16 @@ describe('alias list NUTs', () => { | |
}); | ||
|
||
it('lists multiple results correctly stdout', () => { | ||
const res: string = execCmd('alias list', { ensureExitCode: 0 }).shellOutput; | ||
expect(res).to.include('Alias List\n====='); // Table header | ||
expect(res).to.include('Alias Value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
expect(res).to.include('Admin [email protected]'); | ||
expect(res).to.include('user [email protected]'); | ||
const res = execCmd('alias list', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias List'); // Table header | ||
expect(res).to.include('alias value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
expect(res).to.include('Admin [email protected]'); | ||
expect(res).to.include('user [email protected]'); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -48,14 +48,15 @@ describe('alias set NUTs', () => { | |
}); | ||
|
||
it('alias set multiple values stdout', () => { | ||
const res: string = execCmd('alias set [email protected] [email protected]', { | ||
const res = execCmd('alias set [email protected] [email protected]', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Set\n====='); // Table header | ||
expect(res).to.include('Alias Value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
expect(res).to.include('Admin [email protected]'); | ||
expect(res).to.include('Alias Set'); // Table header | ||
expect(res).to.include('alias value success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
expect(res).to.include('Admin [email protected] true'); | ||
}); | ||
|
||
it('alias set with spaces in value', () => { | ||
|
@@ -101,36 +102,6 @@ describe('alias set NUTs', () => { | |
|
||
expect(res).to.include('Found duplicate argument'); | ||
}); | ||
|
||
// this behavior is now allowed to allow plugin-settings in sfdx | ||
it.skip('alias set DevHub= shows error message to use alias unset command', () => { | ||
const res = execCmd('alias set DevHub=', { | ||
ensureExitCode: 1, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Set\n====='); // Table header | ||
expect(res).to.include('Alias Value Success Message'); | ||
expect(res).to.include(`DevHub false ${messages.getMessages('error.ValueRequired')}`); | ||
}); | ||
|
||
it.skip('alias set DevHub= shows error to use alias unset command (json)', () => { | ||
const result = execCmd('alias set DevHub= --json', { | ||
ensureExitCode: 1, | ||
}).jsonOutput?.result; | ||
|
||
expect(result).to.deep.equal([ | ||
{ | ||
alias: 'DevHub', | ||
success: false, | ||
error: { | ||
name: 'ValueRequiredError', | ||
exitCode: 1, | ||
}, | ||
message: | ||
'You must provide a value when setting an alias. Use `sf alias unset my-alias-name` to remove existing aliases.', | ||
}, | ||
]); | ||
}); | ||
}); | ||
|
||
describe('alias set overwrites existing entry', () => { | ||
|
@@ -151,14 +122,15 @@ describe('alias set NUTs', () => { | |
}); | ||
|
||
it('alias set overwrites entry correctly stdout', () => { | ||
const res: string = execCmd('alias set [email protected] [email protected]', { | ||
const res = execCmd('alias set [email protected] [email protected]', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Set\n====='); // Table header | ||
expect(res).to.include('Alias Value'); | ||
expect(res).to.include('DevHub [email protected]'); | ||
expect(res).to.include('Admin [email protected]'); | ||
expect(res).to.include('Alias Set'); // Table header | ||
expect(res).to.include('alias value success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
expect(res).to.include('Admin [email protected] true'); | ||
}); | ||
}); | ||
|
||
|
@@ -174,7 +146,7 @@ describe('alias set NUTs', () => { | |
}); | ||
|
||
it('alias set without varargs stdout', () => { | ||
const res: string = execCmd('alias set', { | ||
const res = execCmd('alias set', { | ||
ensureExitCode: 1, | ||
}).shellOutput.stderr; | ||
|
||
|
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 |
---|---|---|
|
@@ -40,13 +40,14 @@ describe('alias unset NUTs', () => { | |
}); | ||
|
||
it('unsetting non-existent key is a success (stdout)', () => { | ||
const res: string = execCmd('alias unset noAlias', { | ||
const res = execCmd('alias unset noAlias', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Unset\n====='); // Table header | ||
expect(res).to.include('Alias Value Success'); | ||
expect(res).to.include('noAlias true'); | ||
expect(res).to.include('Alias Unset'); // Table header | ||
expect(res).to.include('alias value success'); | ||
expect(res).to.include('noAlias true'); | ||
}); | ||
}); | ||
|
||
|
@@ -82,13 +83,14 @@ describe('alias unset NUTs', () => { | |
}); | ||
|
||
it('alias unset DevHub', () => { | ||
const res: string = execCmd('alias unset DevHub', { | ||
const res = execCmd('alias unset DevHub', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Unset\n====='); // Table header | ||
expect(res).to.include('Alias Value Success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
expect(res).to.include('Alias Unset'); // Table header | ||
expect(res).to.include('alias value success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
}); | ||
}); | ||
|
||
|
@@ -143,14 +145,15 @@ describe('alias unset NUTs', () => { | |
}); | ||
|
||
it('alias unset DevHub user', () => { | ||
const res: string = execCmd('alias unset DevHub user', { | ||
const res = execCmd('alias unset DevHub user', { | ||
ensureExitCode: 0, | ||
env: { ...process.env, SF_NO_TABLE_STYLE: 'true' }, | ||
}).shellOutput; | ||
|
||
expect(res).to.include('Alias Unset\n====='); // Table header | ||
expect(res).to.include('Alias Value Success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
expect(res).to.include('user [email protected] true'); | ||
expect(res).to.include('Alias Unset'); // Table header | ||
expect(res).to.include('alias value success'); | ||
expect(res).to.include('DevHub [email protected] true'); | ||
expect(res).to.include('user [email protected] true'); | ||
}); | ||
|
||
it('removes all aliases when passing --all', () => { | ||
|
Oops, something went wrong.