-
Notifications
You must be signed in to change notification settings - Fork 139
Wr/corev3 #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wr/corev3 #598
Changes from all commits
2494e1a
16a218a
c775834
f7326f6
f778330
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ import { | |
MetadataTransferResult, | ||
} from './types'; | ||
import { DiagnosticUtil } from './diagnosticUtil'; | ||
|
||
export class DeployResult implements MetadataTransferResult { | ||
public readonly response: MetadataApiDeployStatus; | ||
public readonly components: ComponentSet; | ||
|
@@ -312,19 +313,11 @@ export class MetadataApiDeploy extends MetadataTransfer<MetadataApiDeployStatus, | |
|
||
await new Promise((resolve, reject) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,no-underscore-dangle | ||
connection.metadata | ||
void connection.metadata | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore _invoke is private on the jsforce metadata object, and cancelDeploy is not an exposed method | ||
._invoke('cancelDeploy', { id: this.id }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please make a WI to
|
||
.thenCall((result: unknown) => { | ||
// this does not return CancelDeployResult as documented in the API. | ||
// a null result seems to indicate the request was successful | ||
if (result) { | ||
reject(result); | ||
} else { | ||
resolve(result); | ||
} | ||
}); | ||
.then((result) => (result ? reject(result) : resolve(result))); | ||
}); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,14 @@ import { AuthInfo, Connection } from '@salesforce/core'; | |
import { MockTestOrgData, testSetup } from '@salesforce/core/lib/testSetup'; | ||
import { expect } from 'chai'; | ||
import * as fs from 'graceful-fs'; | ||
import { RecordResult } from 'jsforce'; | ||
import { SaveError, SaveResult } from 'jsforce'; | ||
import { createSandbox, SinonSandbox } from 'sinon'; | ||
import { AnyJson } from '@salesforce/ts-types'; | ||
import { nls } from '../../../src/i18n'; | ||
import { ToolingDeployStatus, ComponentStatus } from '../../../src/client'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there an eslint rule for alphabetizing imports that we can turn on to have less of this happen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is... but I couldn't get it working to match what my IDE did. I'll turn off that setting |
||
import { ComponentStatus, ToolingDeployStatus } from '../../../src/client'; | ||
import { AuraDeploy } from '../../../src/client/deployStrategies'; | ||
import { ToolingCreateResult, AuraDefinition } from '../../../src/client/types'; | ||
import { auraContents, auraComponent, auraFiles, testAuraList } from './auraDeployMocks'; | ||
import { AuraDefinition, ToolingCreateResult } from '../../../src/client/types'; | ||
import { auraComponent, auraContents, auraFiles, testAuraList } from './auraDeployMocks'; | ||
|
||
const $$ = testSetup(); | ||
|
||
|
@@ -36,9 +37,13 @@ describe('Aura Deploy Strategy', () => { | |
|
||
beforeEach(async () => { | ||
sandboxStub = createSandbox(); | ||
$$.setConfigStubContents('AuthInfoConfig', { | ||
contents: await testData.getConfig(), | ||
}); | ||
$$.configStubs.GlobalInfo = { | ||
contents: { | ||
orgs: Object.assign($$.configStubs.GlobalInfo?.contents?.orgs || {}, { | ||
[testData.username]: testData as unknown as AnyJson, | ||
}), | ||
}, | ||
}; | ||
mockConnection = await Connection.create({ | ||
authInfo: await AuthInfo.create({ | ||
username: testData.username, | ||
|
@@ -74,7 +79,7 @@ describe('Aura Deploy Strategy', () => { | |
success: true, | ||
id: '1dcxxx000000060', | ||
errors: [], | ||
} as RecordResult); | ||
} as SaveResult); | ||
|
||
const auraDeploy = new AuraDeploy(mockConnection); | ||
auraDeploy.component = auraComponent; | ||
|
@@ -162,7 +167,7 @@ describe('Aura Deploy Strategy', () => { | |
success: true, | ||
id: '1dcxxx000000034', | ||
errors: [], | ||
} as RecordResult); | ||
} as SaveResult); | ||
|
||
sandboxStub.stub(AuraDeploy.prototype, 'buildMetadataField').returns(testMetadataField); | ||
const auraDeploy = new AuraDeploy(mockConnection); | ||
|
@@ -183,7 +188,7 @@ describe('Aura Deploy Strategy', () => { | |
success: true, | ||
id: '1dcxxx000000034', | ||
errors: [], | ||
} as RecordResult); | ||
} as SaveResult); | ||
|
||
sandboxStub.stub(AuraDeploy.prototype, 'buildMetadataField').returns(testMetadataField); | ||
const auraDeploy = new AuraDeploy(mockConnection); | ||
|
@@ -202,8 +207,8 @@ describe('Aura Deploy Strategy', () => { | |
sandboxStub.stub(mockConnection.tooling, 'create').resolves({ | ||
success: false, | ||
id: '', | ||
errors: ['Unexpected error while creating record'], | ||
} as RecordResult); | ||
errors: [{ message: 'Unexpected error while creating record', errorCode: '1' } as SaveError], | ||
} as SaveResult); | ||
|
||
sandboxStub.stub(AuraDeploy.prototype, 'buildMetadataField').returns(testMetadataField); | ||
const auraDeploy = new AuraDeploy(mockConnection); | ||
|
@@ -223,7 +228,7 @@ describe('Aura Deploy Strategy', () => { | |
success: true, | ||
id: '1dcxxx000000034', | ||
errors: [], | ||
} as RecordResult); | ||
} as SaveResult); | ||
|
||
sandboxStub.stub(AuraDeploy.prototype, 'buildMetadataField').returns(testMetadataField); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's pretty exciting!