Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

feat: use StateAggregator #91

Merged
merged 4 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@oclif/core": "^1.7.0",
"@oclif/plugin-help": "^5.1.11",
"@salesforce/core": "^3.19.0",
"@salesforce/core": "^3.19.4",
"@salesforce/kit": "^1.5.34",
"@salesforce/ts-types": "^1.5.20",
"chalk": "^2.4.2"
Expand Down
5 changes: 3 additions & 2 deletions src/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ const withOrg = (org: Partial<AuthFields> = {}, setAsDefault = true): Plugin<Dic
// eslint-disable-next-line @typescript-eslint/require-await
const writeOrg = async function (this: { path: string }): Promise<JsonMap> {
const foundOrg = asJsonMap(ctx.orgs[org.username as string], {});
return (ensure($$.configStubs.GlobalInfo).contents = { orgs: { [org.username as string]: foundOrg } });
return (ensure($$.configStubs.AuthInfoConfig).contents = foundOrg);
};

$$.configStubs.GlobalInfo = {
$$.configStubs.AuthInfoConfig = {
retrieveContents: readOrg,
updateContents: writeOrg,
};

const defaultOrg = find(ctx.orgs, (o) => !!o.default && !o.isDevHub);
const defaultDevHubOrg = find(ctx.orgs, (o) => !!o.default && !!o.isDevHub);
$$.configStubs.Config = {
Expand Down
8 changes: 4 additions & 4 deletions test/unit/sfdxCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { join } from 'path';
import { URL } from 'url';
import * as util from 'util';
import {
ConfigAggregator,
SfdxConfigAggregator,
Global,
Lifecycle,
Logger,
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('SfdxCommand', () => {
process.exitCode = 0;

UX_OUTPUT = cloneJson(UX_OUTPUT_BASE);
configAggregatorCreate = $$.SANDBOX.stub(ConfigAggregator, 'create').returns(
configAggregatorCreate = $$.SANDBOX.stub(SfdxConfigAggregator, 'create').returns(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Promise.resolve(DEFAULT_INSTANCE_PROPS.configAggregator) as any
);
Expand Down Expand Up @@ -765,7 +765,7 @@ describe('SfdxCommand', () => {
getInfo: () => ({ value: apiVersion }),
};
configAggregatorCreate.restore();
configAggregatorCreate = $$.SANDBOX.stub(ConfigAggregator, 'create').returns(configAggregator);
configAggregatorCreate = $$.SANDBOX.stub(SfdxConfigAggregator, 'create').returns(configAggregator);

// Run the command
class TestCommand extends BaseTestCommand {}
Expand All @@ -792,7 +792,7 @@ describe('SfdxCommand', () => {
getInfo: () => ({ value: apiVersion }),
};
configAggregatorCreate.restore();
configAggregatorCreate = $$.SANDBOX.stub(ConfigAggregator, 'create').returns(configAggregator);
configAggregatorCreate = $$.SANDBOX.stub(SfdxConfigAggregator, 'create').returns(configAggregator);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fakeOrg: any = 'fake_org';
$$.SANDBOX.stub(Org, 'create').returns(fakeOrg);
Expand Down
Loading