Skip to content

Commit 180ee90

Browse files
committed
feat: clear StateAggregator
1 parent e9dcda3 commit 180ee90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/testkit.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { exec, find, mv, rm, which } from 'shelljs';
1515
import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit';
1616
import { AsyncCreatable, Env, set, parseJsonMap } from '@salesforce/kit';
1717
import { AnyJson, Dictionary, ensureString, JsonMap, Nullable } from '@salesforce/ts-types';
18-
import { AuthInfo, Connection, NamedPackageDir, SfProject, SfdxPropertyKeys } from '@salesforce/core';
18+
import { AuthInfo, Connection, NamedPackageDir, SfProject, SfdxPropertyKeys, StateAggregator } from '@salesforce/core';
1919
import { debug, Debugger } from 'debug';
2020
import { MetadataResolver } from '@salesforce/source-deploy-retrieve';
2121
import { Commands, Result, StatusResult } from './types';
@@ -552,9 +552,12 @@ export class SourceTestkit extends AsyncCreatable<SourceTestkit.Options> {
552552

553553
private async createConnection(): Promise<Nullable<Connection>> {
554554
if (this.orgless) return;
555-
return await Connection.create({
555+
StateAggregator.clearInstance();
556+
const conn = await Connection.create({
556557
authInfo: await AuthInfo.create({ username: this.username }),
557558
});
559+
StateAggregator.clearInstance();
560+
return conn;
558561
}
559562

560563
private async doGlob(globs: string[]): Promise<string[]> {

0 commit comments

Comments
 (0)