Skip to content

Commit 9adff64

Browse files
committed
fix tests
1 parent 076accc commit 9adff64

File tree

4 files changed

+38
-72
lines changed

4 files changed

+38
-72
lines changed

__e2e__/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function createCorruptedSetupEnvScript() {
3737

3838
beforeAll(() => {
3939
// Register all packages to be linked
40-
for (const pkg of ['platform-ios', 'platform-android']) {
40+
for (const pkg of ['cli-platform-ios', 'cli-platform-android']) {
4141
spawnScript('yarn', ['link'], {
4242
cwd: path.join(__dirname, `../packages/${pkg}`),
4343
});

__e2e__/root.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const cwd = getTempDirectory('test_different_roots');
1212

1313
beforeAll(() => {
1414
// Register all packages to be linked
15-
for (const pkg of ['platform-ios', 'platform-android']) {
15+
for (const pkg of ['cli-platform-ios', 'cli-platform-android']) {
1616
spawnScript('yarn', ['link'], {
1717
cwd: path.join(__dirname, `../packages/${pkg}`),
1818
});

packages/cli-platform-android/src/commands/runAndroid/__tests__/gradleTaskOutputMock.ts

Lines changed: 0 additions & 70 deletions
This file was deleted.

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,41 @@ import execa from 'execa';
1111
import {Flags} from '..';
1212
import {AndroidProjectConfig} from '@react-native-community/cli-types';
1313

14+
const gradleTaskOutput = `
15+
> Task :tasks
16+
17+
------------------------------------------------------------
18+
Tasks runnable from root project 'Bar'
19+
------------------------------------------------------------
20+
21+
Android tasks
22+
-------------
23+
androidDependencies - Displays the Android dependencies of the project.
24+
signingReport - Displays the signing info for the base and test modules
25+
sourceSets - Prints out all the source sets defined in this project.
26+
27+
Build tasks
28+
-----------
29+
assemble - Assemble main outputs for all the variants.
30+
assembleAndroidTest - Assembles all the Test applications.
31+
assembleDebug - Assembles main outputs for all Debug variants.
32+
assembleRelease - Assembles main outputs for all Release variants.
33+
build - Assembles and tests this project.
34+
buildDependents - Assembles and tests this project and all projects that depend on it.
35+
buildNeeded - Assembles and tests this project and all projects it depends on.
36+
bundle - Assemble bundles for all the variants.
37+
bundleDebug - Assembles bundles for all Debug variants.
38+
bundleRelease - Assembles bundles for all Release variants.
39+
40+
41+
Install tasks
42+
-------------
43+
installDebug - Installs the Debug build.
44+
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
45+
installRelease - Installs the Release build.
46+
uninstallAll - Uninstall all applications.
47+
`;
48+
1449
jest.mock('execa');
1550
jest.mock('../getAdbPath');
1651
jest.mock('../tryLaunchEmulator');
@@ -35,6 +70,7 @@ describe('--appFolder', () => {
3570
};
3671
beforeEach(() => {
3772
jest.clearAllMocks();
73+
(execa.sync as jest.Mock).mockReturnValueOnce({stdout: gradleTaskOutput});
3874
});
3975

4076
it('uses task "install[Variant]" as default task', async () => {

0 commit comments

Comments
 (0)