Skip to content

Commit

Permalink
Merge pull request #363 from zowe/BrokenInteg
Browse files Browse the repository at this point in the history
Broken test erratic results
  • Loading branch information
Colin-Stone committed Dec 3, 2019
2 parents b778fe8 + 1eb40f7 commit 9dc257f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions __tests__/__integration__/USSTree.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,16 @@ describe("USSTree Integration Tests", async () => {
* Tests the deleteSession() function
*************************************************************************************************************/
it("Tests the addSession() function by adding a default, deleting, then adding a passed session", async () => {
const len = testTree.mSessionNodes.length;
let len = testTree.mSessionNodes.length;
const log = new Logger(undefined);
await testTree.addSession();
expect(testTree.mSessionNodes.length).toEqual(len + 1);
testTree.deleteSession(testTree.mSessionNodes[len]);
await testTree.addSession(testConst.profile.name);
expect(testTree.mSessionNodes.length).toBeGreaterThanOrEqual(len + 1);
len = testTree.mSessionNodes.length;
const testNode = testTree.mSessionNodes[len - 1];
testTree.deleteSession(testNode);
len--;
expect(testTree.mSessionNodes.length).toEqual(len);
await testTree.addSession(testNode.label);
expect(testTree.mSessionNodes.length).toEqual(len + 1);
}).timeout(TIMEOUT);

Expand Down
4 changes: 2 additions & 2 deletions src/USSTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ export class USSTree implements vscode.TreeDataProvider<ZoweUSSNode> {
/**
* Adds a new session to the uss files tree
*
* @param {string} [sessionName] - optional; loads default profile if not passed
* @param {string} [sessionName] - optional; loads persisted profiles or default if not passed
*/
public async addSession(sessionName?: string) {
// Loads profile associated with passed sessionName, default if none passed
// Loads profile associated with passed sessionName, persisted profiles or default if none passed
if (sessionName) {
const zosmfProfile: IProfileLoaded = Profiles.getInstance().loadNamedProfile(sessionName);
if (zosmfProfile) {
Expand Down

0 comments on commit 9dc257f

Please sign in to comment.