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: new hooks, updated tests * chore: remove extra comments, refactor test const names
- Loading branch information
1 parent
2ed3da2
commit 81e1058
Showing
9 changed files
with
58 additions
and
35 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
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 |
---|---|---|
|
@@ -12,11 +12,11 @@ import { Dictionary } from '@salesforce/ts-types'; | |
import { Lifecycle } from '@salesforce/core'; | ||
import { Deploy } from '../../../src/commands/force/source/deploy'; | ||
import { FlagOptions } from '../../../src/sourceCommand'; | ||
import { exampleSourceComponent } from './testConsts'; | ||
|
||
describe('force:source:deploy', () => { | ||
const sandbox = sinon.createSandbox(); | ||
const username = '[email protected]'; | ||
const packageXml = 'package.xml'; | ||
|
||
// TODO: When output work items have been done we can test result output | ||
// that more closely matches actual output. | ||
|
@@ -50,6 +50,9 @@ describe('force:source:deploy', () => { | |
}, | ||
initProgressBar: () => {}, | ||
progress: progressStub, | ||
lifecycle: { | ||
emit: lifecycleEmitStub, | ||
}, | ||
print: () => {}, | ||
}) as Promise<DeployResult>; | ||
}; | ||
|
@@ -60,7 +63,9 @@ describe('force:source:deploy', () => { | |
progressStub = sandbox.stub(); | ||
createComponentSetStub = sandbox.stub().returns({ | ||
deploy: deployStub, | ||
getPackageXml: () => packageXml, | ||
toArray: () => { | ||
return [exampleSourceComponent]; | ||
}, | ||
}); | ||
lifecycleEmitStub = sandbox.stub(Lifecycle.prototype, 'emit'); | ||
}); | ||
|
@@ -108,9 +113,7 @@ describe('force:source:deploy', () => { | |
const failureMsg = 'Lifecycle.emit() should be called for predeploy and postdeploy'; | ||
expect(lifecycleEmitStub.calledTwice, failureMsg).to.equal(true); | ||
expect(lifecycleEmitStub.firstCall.args[0]).to.equal('predeploy'); | ||
expect(lifecycleEmitStub.firstCall.args[1]).to.deep.equal({ | ||
packageXmlPath: packageXml, | ||
}); | ||
expect(lifecycleEmitStub.firstCall.args[1]).to.deep.equal([exampleSourceComponent]); | ||
expect(lifecycleEmitStub.secondCall.args[0]).to.equal('postdeploy'); | ||
expect(lifecycleEmitStub.secondCall.args[1]).to.deep.equal(stubbedResults); | ||
}; | ||
|
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
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