Skip to content

Commit db1ad2b

Browse files
committed
fix(test): expect for relevant function
1 parent 1c15036 commit db1ad2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
parseTasksFromGradleFile,
66
promptForTaskSelection,
77
} from '../listAndroidTasks';
8-
8+
import tools from '@react-native-community/cli-tools';
99
const gradleTaskOutput = `
1010
> Task :tasks
1111
@@ -111,9 +111,11 @@ describe('promptForTaskSelection', () => {
111111
}),
112112
);
113113

114+
const promptSpy = jest.spyOn(tools, 'prompt');
115+
114116
promptForTaskSelection('install', 'sourceDir');
115117

116-
expect(prompts).toHaveBeenCalledWith({
118+
expect(promptSpy).toHaveBeenCalledWith({
117119
choices: tasksList.map((t) => ({
118120
title: `${chalk.bold(t.task)} - ${t.description}`,
119121
value: t.task,

0 commit comments

Comments
 (0)