Skip to content

Commit

Permalink
fix: exclude field timestamp for r1
Browse files Browse the repository at this point in the history
@W-9670175@
  • Loading branch information
peternhale committed Jul 29, 2021
1 parent c9a2522 commit b2ea721
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "2.2.2",
"@oclif/test": "^1.2.8",
"@salesforce/cli-plugins-testkit": "^1.2.0",
"@salesforce/cli-plugins-testkit": "^1.2.1",
"@salesforce/dev-config": "^2.1.2",
"@salesforce/dev-scripts": "^0.9.18",
"@salesforce/plugin-command-reference": "^1.3.0",
Expand Down
10 changes: 6 additions & 4 deletions src/commands/env/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ export default class EnvDisplay extends Command {

if (!flags.json) {
cli.table(
Object.keys(foundAuthorization).map((key, i) => ({
key,
value: Object.values(foundAuthorization)[i] ?? '',
})),
Object.keys(foundAuthorization)
.filter((key) => key !== 'timestamp')
.map((key, i) => ({
key,
value: Object.values(foundAuthorization)[i] ?? '',
})),
columns
);
}
Expand Down
4 changes: 4 additions & 0 deletions test/commands/env/display.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const expectedSfOrgs: Array<Partial<SfOrg>> = [
instanceUrl: 'https://some.salesforce.com',
oauthMethod: 'jwt',
username: '[email protected]',
timestamp: '2021-07-28T18:04:08.652Z',
},
{
orgId: '00Dxx54321987654321',
Expand All @@ -28,6 +29,7 @@ const expectedSfOrgs: Array<Partial<SfOrg>> = [
alias: 'someOtherAlias',
oauthMethod: 'web',
username: '[email protected]',
timestamp: '2021-07-28T18:04:08.652Z',
error: 'some auth error',
},
];
Expand Down Expand Up @@ -55,6 +57,7 @@ describe('display unit tests', () => {
expect(stdout).to.include(sfOrg.username);
expect(stdout).to.include(sfOrg.oauthMethod);
expect(stdout).to.include(sfOrg.instanceUrl);
expect(stdout).to.not.include('timestamp');
});
});
test
Expand All @@ -70,6 +73,7 @@ describe('display unit tests', () => {
expect(stdout).to.include(sfOrg.username);
expect(stdout).to.include(sfOrg.oauthMethod);
expect(stdout).to.include(sfOrg.instanceUrl);
expect(stdout).to.not.include('timestamp');
});
});
// this test will start to fail when env plugin incorporates more than authorization environment
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@
mv "~2"
safe-json-stringify "~1"

"@salesforce/cli-plugins-testkit@^1.2.0":
"@salesforce/cli-plugins-testkit@^1.2.1":
version "1.2.1"
resolved "https://registry.npmjs.org/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-1.2.1.tgz#c25ba3780f9e42386d8b563519b2fb8278b26088"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-1.2.1.tgz#c25ba3780f9e42386d8b563519b2fb8278b26088"
integrity sha512-hD1VdDT2qUIPTy+pGU8Ot43TJwMMBrkrysgh8Wuf8KRcF9UtNv76mdg2f+6aYKmKmMeJQVhnnswb43RJXns2Dg==
dependencies:
"@salesforce/core" "^2.24.0"
Expand Down

0 comments on commit b2ea721

Please sign in to comment.