Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: oclif exit codes #520

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^4.0.16",
"@salesforce/cli-plugins-testkit": "^4.4.12",
"@salesforce/cli-plugins-testkit": "^5.1.1",
"@salesforce/dev-scripts": "^8.1.2",
"@salesforce/plugin-command-reference": "^3.0.51",
"@swc/core": "1.3.100",
Expand Down
4 changes: 2 additions & 2 deletions test/commands/package1/versionDisplay.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ describe('package1:version:display', () => {
it('should validate packageversionid flag (too short)', () => {
// fake package ID - too short
const command = `package1:version:display -i 04t46000001Zfa -o ${session.hubOrg.username}`;
const output = execCmd(command, { ensureExitCode: 1 }).shellOutput.stderr;
const output = execCmd(command, { ensureExitCode: 'nonZero' }).shellOutput.stderr;
expect(output).to.contain('The id must be 15 or 18 characters.');
});

it("should validate packageversionid flag (doesn't start with 04t)", () => {
// fake package ID - not an 04t package
const command = `package1:version:display -i 05t46000001ZfaAAAS -o ${session.hubOrg.username}`;
const output = execCmd(command, { ensureExitCode: 1 }).shellOutput.stderr;
const output = execCmd(command, { ensureExitCode: 'nonZero' }).shellOutput.stderr;
expect(output).to.contain('The id must begin with 04t');
});

Expand Down
4 changes: 2 additions & 2 deletions test/commands/package1/versionList.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ describe('package1:version:list', () => {
it("should validate packageversionid flag (doesn't start with 033)", () => {
// fake package ID - not an 033 package
const command = `package1:version:list -i 03446000001ZfaAAAS -o ${session.hubOrg.username}`;
const output = execCmd(command, { ensureExitCode: 1 }).shellOutput.stderr;
const output = execCmd(command, { ensureExitCode: 'nonZero' }).shellOutput.stderr;
expect(output).to.contain('The id must begin with 033.');
});

it('should validate packageversionid flag (too short)', () => {
// fake package ID - not an 033 package
const command = `package1:version:list -i 03346000001Zfa -o ${session.hubOrg.username}`;
const output = execCmd(command, { ensureExitCode: 1 }).shellOutput.stderr;
const output = execCmd(command, { ensureExitCode: 'nonZero' }).shellOutput.stderr;
expect(output).to.contain('The id must be 18 characters.');
});

Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -970,22 +970,22 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@salesforce/cli-plugins-testkit@^4.4.12":
version "4.4.12"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-4.4.12.tgz#425132a4cd49b5aacb979df07af987b338ec00ae"
integrity sha512-k0jJYqB0PazmVyhNBau8FtJDa3+4EbhvD8F3u+yZ71jjPkp7YLKqtxfs1y7P3LCrmtel8JE3faHTfMaahdK96Q==
"@salesforce/cli-plugins-testkit@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.1.1.tgz#73baef2d27abc6cbb11c82e2869a3b4b57ff342d"
integrity sha512-qllBs+dGYIMS7GrJfJaalJSNsNohDAiLLHOZXk8WL+aZ1dRGDaWTiS4gyZKPKgeahXuNPTBxDqNg7WajvfNcxg==
dependencies:
"@salesforce/core" "^5.3.10"
"@salesforce/core" "^6.4.0"
"@salesforce/kit" "^3.0.15"
"@salesforce/ts-types" "^2.0.6"
"@types/shelljs" "^0.8.14"
"@salesforce/ts-types" "^2.0.9"
"@types/shelljs" "^0.8.15"
debug "^4.3.1"
jszip "^3.10.1"
shelljs "^0.8.4"
strip-ansi "6.0.1"
ts-retry-promise "^0.7.1"

"@salesforce/core@^5.3.10", "@salesforce/core@^5.3.20":
"@salesforce/core@^5.3.20":
version "5.3.20"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-5.3.20.tgz#4e934d4551bb70423cb1c4115615bc41cffca41e"
integrity sha512-y+O6O2c8OYFDrAy2qsG+pAcNxoyL14nmBXcBRRcYA7Huj8ikK+aLJK84PuVAYdQz+hNwImQF+69IWtDkpK4Irg==
Expand Down Expand Up @@ -1152,7 +1152,7 @@
minimatch "^5.1.6"
proxy-agent "^6.3.1"

"@salesforce/ts-types@^2.0.6", "@salesforce/ts-types@^2.0.9":
"@salesforce/ts-types@^2.0.9":
version "2.0.9"
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.9.tgz#66bff7b41720065d6b01631b6f6a3ccca02857c5"
integrity sha512-boUD9jw5vQpTCPCCmK/NFTWjSuuW+lsaxOynkyNXLW+zxOc4GDjhtKc4j0vWZJQvolpafbyS8ZLFHZJvs12gYA==
Expand Down Expand Up @@ -1481,10 +1481,10 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339"
integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==

"@types/shelljs@^0.8.14":
version "0.8.14"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.14.tgz#87b8817b2397ffe97b86a4d844036ee0d2a1f0ca"
integrity sha512-eqKaGPi60riuxI9pUVeCT02EGo94Y6HT119h7w5bXSELsis6+JqzdEy6H/w2xXl881wcN3VDnb/D0WlgSety5w==
"@types/shelljs@^0.8.15":
version "0.8.15"
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.15.tgz#22c6ab9dfe05cec57d8e6cb1a95ea173aee9fcac"
integrity sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q==
dependencies:
"@types/glob" "~7.2.0"
"@types/node" "*"
Expand Down
Loading