Skip to content

Commit

Permalink
fix: fix broken tests due to changes in test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Aug 6, 2023
1 parent c297909 commit d2ef9ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const $$ = new TestContext();
const createOrg = async () => {
const testData = new MockTestOrgData();

await $$.stubAuths(testData);
await $$.stubAliases({ myAlias: testData.username });
await $$.stubConfig({ [OrgConfigProperties.TARGET_ORG]: testData.username });

return await SFPOrg.create({ aliasOrUsername: testData.username });
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/permsets/AssignPermissionSets.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import child_process = require('child_process');
const child_process = require('child_process');
import AssignPermissionSetsImpl from '../../src/permsets/AssignPermissionSetsImpl';
import { jest, expect } from '@jest/globals';
import { VoidLogger } from '@dxatscale/sfp-logger';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { jest, expect } from '@jest/globals';
import { MockTestOrgData, testSetup } from '@salesforce/core/lib/testSetup';
import { Connection, AuthInfo } from '@salesforce/core';
import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup';
import { Connection, AuthInfo, OrgConfigProperties } from '@salesforce/core';
import ShrinkImpl from '../../../src/impl/dependency/ShrinkImpl';
const $$ = testSetup();
const $$ =new TestContext();

const setupFakeConnection = async () => {
const testData = new MockTestOrgData();
testData.makeDevHub();

$$.setConfigStubContents('AuthInfoConfig', {
contents: await testData.getConfig(),
});
await $$.stubAuths(testData);
await $$.stubAliases({ myAlias: testData.username });
await $$.stubConfig({ [OrgConfigProperties.TARGET_ORG]: testData.username });

$$.fakeConnectionRequest = (request) => {
return Promise.resolve(response);
};
Expand Down

0 comments on commit d2ef9ef

Please sign in to comment.