Skip to content

Commit b73e467

Browse files
committed
test: stub dev hub
1 parent c2f4e82 commit b73e467

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/shared/scratchOrgRequest.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
import { Config, Interfaces } from '@oclif/core';
88
import { expect } from 'chai';
9+
import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup';
910
import { buildScratchOrgRequest } from '../../src/shared/scratchOrgRequest';
1011
import EnvCreateScratch from '../../src/commands/org/create/scratch';
1112

@@ -21,6 +22,18 @@ const paramsToFlags = async (params: string[]): Promise<Interfaces.InferredFlags
2122
new Wrapper(params, {} as Config).getFlags();
2223

2324
describe('buildScratchOrgRequest function', () => {
25+
const $$ = new TestContext();
26+
beforeEach(async () => {
27+
const hub = new MockTestOrgData();
28+
hub.isDevHub = true;
29+
await $$.stubAuths(hub);
30+
await $$.stubConfig({ 'target-dev-hub': hub.username });
31+
});
32+
33+
after(() => {
34+
$$.SANDBOX.restore();
35+
});
36+
2437
it('edition as only flag', async () => {
2538
const flags = await paramsToFlags(['--edition', 'developer']);
2639
const result = await buildScratchOrgRequest(flags);

0 commit comments

Comments
 (0)