-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: use StateAggregator * fix: use await * chore: fix tests * chore: auto-update metadata coverage in METADATA_SUPPORT.md Co-authored-by: Eric Willhoit <[email protected]>
- Loading branch information
1 parent
123f51e
commit f1d8848
Showing
15 changed files
with
557 additions
and
569 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
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
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ import { join } from 'path'; | |
import { MockTestOrgData, testSetup } from '@salesforce/core/lib/testSetup'; | ||
import { expect } from 'chai'; | ||
import { createSandbox, SinonStub } from 'sinon'; | ||
import { AnyJson } from '@salesforce/ts-types'; | ||
import { AuthInfo, Connection, Messages } from '@salesforce/core'; | ||
import { | ||
ComponentSet, | ||
|
@@ -247,7 +246,7 @@ describe('ComponentSet', () => { | |
|
||
describe('fromConnection', () => { | ||
it('should initialize using a connection', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const expected: MetadataComponent[] = [ | ||
{ | ||
fullName: 'Test', | ||
|
@@ -279,16 +278,10 @@ describe('ComponentSet', () => { | |
apiVersion: '50.0', | ||
}); | ||
env.stub(RegistryAccess.prototype, 'getTypeByName').returns(registry.types.apexclass); | ||
const testData = new MockTestOrgData(); | ||
const username = '[email protected]'; | ||
const testData = new MockTestOrgData($$.uniqid(), { username }); | ||
|
||
$$.configStubs.GlobalInfo = { | ||
contents: { | ||
orgs: Object.assign($$.configStubs.GlobalInfo?.contents?.orgs || {}, { | ||
[username]: testData as unknown as AnyJson, | ||
}), | ||
}, | ||
}; | ||
await $$.stubAuths(testData); | ||
const set = await ComponentSet.fromConnection({ | ||
usernameOrConnection: username, | ||
apiVersion: '50.0', | ||
|
@@ -301,15 +294,9 @@ describe('ComponentSet', () => { | |
}); | ||
|
||
it('should initialize using an username', async () => { | ||
const testData = new MockTestOrgData(); | ||
const username = '[email protected]'; | ||
$$.configStubs.GlobalInfo = { | ||
contents: { | ||
orgs: Object.assign($$.configStubs.GlobalInfo?.contents?.orgs || {}, { | ||
[username]: testData as unknown as AnyJson, | ||
}), | ||
}, | ||
}; | ||
const testData = new MockTestOrgData($$.uniqid(), { username }); | ||
await $$.stubAuths(testData); | ||
const connection = await Connection.create({ | ||
authInfo: await AuthInfo.create({ | ||
username: '[email protected]', | ||
|
@@ -642,7 +629,7 @@ describe('ComponentSet', () => { | |
|
||
describe('deploy', () => { | ||
it('should properly construct a deploy operation', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const set = ComponentSet.fromSource({ | ||
fsPaths: ['.'], | ||
registry: registryAccess, | ||
|
@@ -664,7 +651,7 @@ describe('ComponentSet', () => { | |
}); | ||
|
||
it('should properly construct a deploy operation with overridden apiVersion', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const apiVersion = '50.0'; | ||
const set = ComponentSet.fromSource({ | ||
fsPaths: ['.'], | ||
|
@@ -708,7 +695,7 @@ describe('ComponentSet', () => { | |
|
||
describe('retrieve', () => { | ||
it('should properly construct a retrieve operation', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const set = ComponentSet.fromSource({ | ||
fsPaths: ['.'], | ||
registry: registryAccess, | ||
|
@@ -737,7 +724,7 @@ describe('ComponentSet', () => { | |
}); | ||
|
||
it('should properly construct a retrieve operation with overridden apiVersion', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const apiVersion = '50.0'; | ||
const set = ComponentSet.fromSource({ | ||
fsPaths: ['.'], | ||
|
@@ -769,7 +756,7 @@ describe('ComponentSet', () => { | |
}); | ||
|
||
it('should properly construct a retrieve operation with packageName', async () => { | ||
const connection = await mockConnection($$); | ||
const connection = await mockConnection(); | ||
const set = new ComponentSet([]); | ||
const operationArgs = { | ||
components: set, | ||
|
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
Oops, something went wrong.