Skip to content

Commit 6555636

Browse files
committed
fix tests
1 parent 6df62b2 commit 6555636

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/platform-android/src/lib/commands/runAndroid/__tests__/runAndroid.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ test.each([['release'], ['debug'], ['staging']])(
311311
{ ...args, variant },
312312
'/',
313313
undefined,
314-
{ extraSources: [], ignorePaths: [] },
314+
{ extraSources: [], ignorePaths: [], env: [] },
315315
);
316316

317317
expect(tools.outro).toBeCalledWith('Success 🎉.');
@@ -360,7 +360,7 @@ test('runAndroid runs gradle build with custom --appId, --appIdSuffix and --main
360360
},
361361
'/',
362362
undefined,
363-
{ extraSources: [], ignorePaths: [] },
363+
{ extraSources: [], ignorePaths: [], env: [] },
364364
);
365365

366366
expect(tools.outro).toBeCalledWith('Success 🎉.');
@@ -387,7 +387,7 @@ test('runAndroid fails to launch an app on not-connected device when specified w
387387
{ ...args, device: 'emulator-5554' },
388388
'/',
389389
undefined,
390-
{ extraSources: [], ignorePaths: [] },
390+
{ extraSources: [], ignorePaths: [], env: [] },
391391
);
392392
expect(logWarnSpy).toBeCalledWith(
393393
'No devices or emulators found matching "emulator-5554". Using available one instead.',
@@ -456,7 +456,7 @@ test.each([['release'], ['debug']])(
456456
{ ...args, device: 'emulator-5554', variant },
457457
'/',
458458
undefined,
459-
{ extraSources: [], ignorePaths: [] },
459+
{ extraSources: [], ignorePaths: [], env: [] },
460460
);
461461

462462
// we don't want to run installDebug when a device is selected, because gradle will install the app on all connected devices
@@ -516,6 +516,7 @@ test('runAndroid launches an app on all connected devices', async () => {
516516
await runAndroid({ ...androidProject }, { ...args }, '/', undefined, {
517517
extraSources: [],
518518
ignorePaths: [],
519+
env: [],
519520
});
520521

521522
// Runs assemble debug task with active architectures arm64-v8a, armeabi-v7a
@@ -582,7 +583,7 @@ test('runAndroid skips building when --binary-path is passed', async () => {
582583
},
583584
'/root',
584585
undefined,
585-
{ extraSources: [], ignorePaths: [] },
586+
{ extraSources: [], ignorePaths: [], env: [] },
586587
);
587588

588589
// Skips gradle

packages/platform-harmony/src/lib/commands/build/__tests__/buildHarmony.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const args: BuildFlags = {
99
buildMode: 'debug',
1010
module: 'entry',
1111
product: 'default',
12-
extraParams: undefined,
1312
local: true,
1413
};
1514
const harmonyProject: HarmonyProjectConfig = {
@@ -32,9 +31,12 @@ const spinnerMock = vi.hoisted(() => ({
3231

3332
vi.spyOn(tools, 'spinner').mockImplementation(() => spinnerMock);
3433

34+
const OLD_ENV = process.env;
35+
3536
beforeEach(() => {
3637
vi.resetModules();
3738
vi.clearAllMocks();
39+
process.env = { ...OLD_ENV, DEVECO_SDK_HOME: '/mock/deveco/sdk' };
3840
});
3941

4042
function mockOhpmCall(file: string, args: string[]) {

0 commit comments

Comments
 (0)