generated from salesforcecli/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow deploy report on validated deploys
- Loading branch information
1 parent
b0760a9
commit 9d3f0b9
Showing
2 changed files
with
62 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2023, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
import * as path from 'node:path'; | ||
import { assert, expect } from 'chai'; | ||
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; | ||
import { DeployResultJson } from '../../../src/utils/types.js'; | ||
|
||
describe('project deploy report', () => { | ||
let testkit: TestSession; | ||
|
||
before(async () => { | ||
testkit = await TestSession.create({ | ||
project: { gitClone: 'https://github.com/trailheadapps/dreamhouse-lwc' }, | ||
scratchOrgs: [{ setDefault: true, config: path.join('config', 'project-scratch-def.json') }], | ||
devhubAuthStrategy: 'AUTO', | ||
}); | ||
execCmd<DeployResultJson>('project deploy start', { | ||
ensureExitCode: 0, | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await testkit?.clean(); | ||
}); | ||
|
||
it('can validate / deploy quick / report', () => { | ||
const validate = execCmd<DeployResultJson>('project deploy validate --metadata ApexClass --json', { | ||
ensureExitCode: 0, | ||
}).jsonOutput; | ||
assert(validate); | ||
expect(validate.result.checkOnly).to.be.true; | ||
expect(validate.result.done).to.be.true; | ||
expect(validate.result.success).to.be.true; | ||
const validateId = validate.result.id; | ||
|
||
const quick = execCmd<DeployResultJson>(`project deploy quick --job-id ${validateId} --json`, { | ||
ensureExitCode: 0, | ||
}).jsonOutput; | ||
assert(quick); | ||
expect(quick.result.checkOnly).to.be.false; | ||
expect(quick.result.done).to.be.true; | ||
expect(quick.result.success).to.be.true; | ||
const quickId = quick.result.id; | ||
|
||
const report = execCmd<DeployResultJson>(`project deploy report --job-id ${quickId} --json`, { | ||
ensureExitCode: 0, | ||
}).jsonOutput; | ||
assert(report); | ||
expect(report.result.checkOnly).to.be.false; | ||
expect(report.result.done).to.be.true; | ||
expect(report.result.success).to.be.true; | ||
}); | ||
}); |