mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
Disallow floating promises. (#14605)
This commit is contained in:
committed by
GitHub
parent
3cf44acc08
commit
025e450ac2
@@ -72,6 +72,7 @@ describe('directoryCommand', () => {
|
||||
describe('show', () => {
|
||||
it('should display the list of directories', () => {
|
||||
if (!showCommand?.action) throw new Error('No action');
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
showCommand.action(mockContext, '');
|
||||
expect(mockWorkspaceContext.getDirectories).toHaveBeenCalled();
|
||||
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
|
||||
@@ -101,6 +102,7 @@ describe('directoryCommand', () => {
|
||||
|
||||
it('should show an error if no path is provided', () => {
|
||||
if (!addCommand?.action) throw new Error('No action');
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
addCommand.action(mockContext, '');
|
||||
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -92,6 +92,7 @@ function updateAction(context: CommandContext, args: string): Promise<void> {
|
||||
extensions,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
updateComplete.then((updateInfos) => {
|
||||
if (updateInfos.length === 0) {
|
||||
context.ui.addItem(
|
||||
|
||||
@@ -30,6 +30,7 @@ describe('statsCommand', () => {
|
||||
it('should display general session stats when run with no subcommand', () => {
|
||||
if (!statsCommand.action) throw new Error('Command has no action');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
statsCommand.action(mockContext, '');
|
||||
|
||||
const expectedDuration = formatDuration(
|
||||
@@ -50,6 +51,7 @@ describe('statsCommand', () => {
|
||||
);
|
||||
if (!modelSubCommand?.action) throw new Error('Subcommand has no action');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
modelSubCommand.action(mockContext, '');
|
||||
|
||||
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
|
||||
@@ -66,6 +68,7 @@ describe('statsCommand', () => {
|
||||
);
|
||||
if (!toolsSubCommand?.action) throw new Error('Subcommand has no action');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
toolsSubCommand.action(mockContext, '');
|
||||
|
||||
expect(mockContext.ui.addItem).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user