Skip to content

Commit

Permalink
test: oclif exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Dec 15, 2023
1 parent 31a63e8 commit 4c2da87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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: 2 }).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: 2 }).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: 2 }).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: 2 }).shellOutput.stderr;
expect(output).to.contain('The id must be 18 characters.');
});

Expand Down

0 comments on commit 4c2da87

Please sign in to comment.