generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: throw deploy error when missing required params (#150)
* fix: throw deploy error when missing required params * chore: comma separate values Co-authored-by: Willie Ruemmele <[email protected]>
- Loading branch information
1 parent
95739bf
commit 234c596
Showing
3 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import * as sinon from 'sinon'; | |
import { expect } from 'chai'; | ||
import { MetadataApiDeployOptions } from '@salesforce/source-deploy-retrieve'; | ||
import { fromStub, stubInterface, stubMethod } from '@salesforce/ts-sinon'; | ||
import { ConfigAggregator, Lifecycle, Org, SfdxProject } from '@salesforce/core'; | ||
import { ConfigAggregator, Lifecycle, Org, SfdxProject, Messages } from '@salesforce/core'; | ||
import { UX } from '@salesforce/command'; | ||
import { IConfig } from '@oclif/config'; | ||
import { Deploy } from '../../../src/commands/force/source/deploy'; | ||
|
@@ -24,6 +24,10 @@ import { DeployProgressBarFormatter } from '../../../src/formatters/deployProgre | |
import { DeployProgressStatusFormatter } from '../../../src/formatters/deployProgressStatusFormatter'; | ||
import { getDeployResult } from './deployResponses'; | ||
import { exampleSourceComponent } from './testConsts'; | ||
|
||
Messages.importMessagesDirectory(__dirname); | ||
const messages = Messages.loadMessages('@salesforce/plugin-source', 'deploy'); | ||
|
||
describe('force:source:deploy', () => { | ||
const sandbox = sinon.createSandbox(); | ||
const username = '[email protected]'; | ||
|
@@ -177,6 +181,15 @@ describe('force:source:deploy', () => { | |
expect(initProgressBarStub.callCount).to.equal(callCount); | ||
}; | ||
|
||
it('should error if sourcepath or manifest arguments are not provided', async () => { | ||
const requiredFlags = 'manifest, metadata, sourcepath, validateddeployrequestid'; | ||
try { | ||
await runDeployCmd([]); | ||
} catch (e) { | ||
expect((e as Error).message).to.equal(messages.getMessage('MissingRequiredParam', [requiredFlags])); | ||
} | ||
}); | ||
|
||
it('should pass along sourcepath', async () => { | ||
const sourcepath = ['somepath']; | ||
const result = await runDeployCmd(['--sourcepath', sourcepath[0], '--json']); | ||
|