Skip to content

Commit

Permalink
Merge pull request #668 from salesforcecli/mdonnalley/update-nuts
Browse files Browse the repository at this point in the history
test: expect nonZero exit code
  • Loading branch information
mdonnalley authored Dec 4, 2023
2 parents 67aa639 + 2c5f8eb commit 4a1ffb1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.0.2",
"@salesforce/cli-plugins-testkit": "^5.0.6",
"@salesforce/cli-plugins-testkit": "^5.1.0",
"@salesforce/dev-scripts": "^7.1.1",
"@salesforce/plugin-command-reference": "^3.0.48",
"eslint-plugin-sf-plugin": "^1.16.15",
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/local/createCMDT.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('force:cmdt:create', () => {
});

it('runs force:cmdt:create --typename MyC__MDT --visibility "Invalid"', () => {
const result = execCmd('force:cmdt:create --typename MyC --visibility Invalid', { ensureExitCode: 1 });
const result = execCmd('force:cmdt:create --typename MyC --visibility Invalid', { ensureExitCode: 'nonZero' });
expect(result.shellOutput.stderr).to.contain(
'Expected --visibility=Invalid to be one of: PackageProtected, Protected, Public'
);
Expand Down
8 changes: 5 additions & 3 deletions test/nuts/local/createField.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,22 @@ describe('force:cmdt:field:create', () => {

describe('failures', () => {
it('fails running force:cmdt:field:create --fieldname myFi__eld --fieldtype Text', () => {
const result = execCmd('force:cmdt:field:create --fieldname myFi__eld --fieldtype Text', { ensureExitCode: 1 });
const result = execCmd('force:cmdt:field:create --fieldname myFi__eld --fieldtype Text', {
ensureExitCode: 'nonZero',
});
expect(result.shellOutput.stderr).to.contain(messages.getMessage('invalidCustomFieldError', ['myFi__eld']));
});

it('fails running force:cmdt:field:create --fieldname myField --fieldtype Picklist', () => {
const result = execCmd('force:cmdt:field:create --fieldname myField --fieldtype Picklist', {
ensureExitCode: 1,
ensureExitCode: 'nonZero',
});
expect(result.shellOutput.stderr).to.contain(messages.getMessage('picklistValuesNotSuppliedError'));
});

it('fails running force:cmdt:field:create --fieldname money --fieldtype Currency', () => {
const result = execCmd('force:cmdt:field:create --fieldname money --fieldtype Currency', {
ensureExitCode: 1,
ensureExitCode: 'nonZero',
});
expect(result.shellOutput.stderr).to.contain(
'Expected --type=Currency to be one of: Checkbox, Date, DateTime, Email, Number, Percent, Phone, Picklist, Text, TextArea, LongTextArea, Url'
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,10 @@
dependencies:
"@octokit/openapi-types" "^12.11.0"

"@salesforce/cli-plugins-testkit@^5.0.6":
version "5.0.6"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.0.6.tgz#16fb3378406b19ba7b70ebec58c27d683141c571"
integrity sha512-1zbyVpATCSgcL8X6svic2MNqIGGJLUQAwkLmTiibwiudnKGZhkXj1kF+46c2mr5oi4hLKk7Bpzq2fO45MT14/A==
"@salesforce/cli-plugins-testkit@^5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.1.0.tgz#8d9caa22ea9e99879629206892afb26bcd540cef"
integrity sha512-P5tYlNqE87lX9Yp2aAsK75PICoAbmrSK3LEqiIVbtn75PN3OKiD1JEEX2ZDu+HWtO4/nxPtO4JFvX5j00EZGBA==
dependencies:
"@salesforce/core" "^6.2.2"
"@salesforce/kit" "^3.0.15"
Expand Down

0 comments on commit 4a1ffb1

Please sign in to comment.