diff --git a/packages/cli/src/__tests__/commands/apps.test.ts b/packages/cli/src/__tests__/commands/apps.test.ts index fe58de61..1e948264 100644 --- a/packages/cli/src/__tests__/commands/apps.test.ts +++ b/packages/cli/src/__tests__/commands/apps.test.ts @@ -29,7 +29,7 @@ describe('AppsCommand', () => { }) it('calls outputListing with correct config', async () => { - await expect(AppsCommand.run()).resolves.not.toThrow() + await expect(AppsCommand.run([])).resolves.not.toThrow() expect(outputListing).toBeCalledWith( expect.any(AppsCommand), @@ -61,7 +61,7 @@ describe('AppsCommand', () => { }) it('calls correct list endpoint', async () => { - await expect(AppsCommand.run()).resolves.not.toThrow() + await expect(AppsCommand.run([])).resolves.not.toThrow() expect(listSpy).toBeCalled() }) diff --git a/packages/cli/src/__tests__/commands/apps/authorize.test.ts b/packages/cli/src/__tests__/commands/apps/authorize.test.ts index 71b1f8c6..fc8343c6 100644 --- a/packages/cli/src/__tests__/commands/apps/authorize.test.ts +++ b/packages/cli/src/__tests__/commands/apps/authorize.test.ts @@ -19,7 +19,7 @@ describe('AppsAuthorizeCommand', () => { }) it('requires ARN arg', async () => { - await expect(AppsAuthorizeCommand.run()).rejects.toThrow('Missing 1 required arg:\narn') + await expect(AppsAuthorizeCommand.run([])).rejects.toThrow('Missing 1 required arg:\narn') }) it('calls addPermission with required ARN', async () => { diff --git a/packages/cli/src/__tests__/commands/apps/create.test.ts b/packages/cli/src/__tests__/commands/apps/create.test.ts index 63c06885..bd32a26c 100644 --- a/packages/cli/src/__tests__/commands/apps/create.test.ts +++ b/packages/cli/src/__tests__/commands/apps/create.test.ts @@ -37,7 +37,7 @@ describe('AppCreateCommand', () => { }) const buildTableSpy = jest.spyOn(DefaultTableGenerator.prototype, 'buildTableFromItem') - await expect(AppCreateCommand.run()).resolves.not.toThrow() + await expect(AppCreateCommand.run([])).resolves.not.toThrow() expect(mockInputOutput).toBeCalledWith( expect.any(AppCreateCommand), @@ -55,7 +55,7 @@ describe('AppCreateCommand', () => { await actionFunction(undefined, appRequest) }) - await expect(AppCreateCommand.run()).resolves.not.toThrow() + await expect(AppCreateCommand.run([])).resolves.not.toThrow() expect(createSpy).toBeCalledWith(appRequest) }) diff --git a/packages/cli/src/__tests__/commands/apps/delete.test.ts b/packages/cli/src/__tests__/commands/apps/delete.test.ts index 69b289f7..c06f6356 100644 --- a/packages/cli/src/__tests__/commands/apps/delete.test.ts +++ b/packages/cli/src/__tests__/commands/apps/delete.test.ts @@ -16,7 +16,7 @@ describe('AppDeleteCommand', () => { }) it('prompts user to choose app', async () => { - await expect(AppDeleteCommand.run()).resolves.not.toThrow() + await expect(AppDeleteCommand.run([])).resolves.not.toThrow() expect(chooseApp).toBeCalledWith(expect.any(AppDeleteCommand), undefined) }) diff --git a/packages/cli/src/__tests__/commands/apps/oauth.test.ts b/packages/cli/src/__tests__/commands/apps/oauth.test.ts index f1046e69..b3cd0472 100644 --- a/packages/cli/src/__tests__/commands/apps/oauth.test.ts +++ b/packages/cli/src/__tests__/commands/apps/oauth.test.ts @@ -32,7 +32,7 @@ describe('AppOauthCommand', () => { }) it('prompts user to choose app allowing index', async () => { - await expect(AppOauthCommand.run()).resolves.not.toThrow() + await expect(AppOauthCommand.run([])).resolves.not.toThrow() expect(mockChooseApp).toBeCalledWith( expect.any(AppOauthCommand), @@ -42,7 +42,7 @@ describe('AppOauthCommand', () => { }) it('calls outputItem with correct config', async () => { - await expect(AppOauthCommand.run()).resolves.not.toThrow() + await expect(AppOauthCommand.run([])).resolves.not.toThrow() expect(mockOutput).toBeCalledWith( expect.any(AppOauthCommand), diff --git a/packages/cli/src/__tests__/commands/apps/oauth/generate.test.ts b/packages/cli/src/__tests__/commands/apps/oauth/generate.test.ts index e87621ce..0189708f 100644 --- a/packages/cli/src/__tests__/commands/apps/oauth/generate.test.ts +++ b/packages/cli/src/__tests__/commands/apps/oauth/generate.test.ts @@ -30,13 +30,13 @@ describe('AppOauthGenerateCommand', () => { }) it('prompts user to choose app', async () => { - await expect(AppOauthGenerateCommand.run()).resolves.not.toThrow() + await expect(AppOauthGenerateCommand.run([])).resolves.not.toThrow() expect(mockChooseApp).toBeCalledWith(expect.any(AppOauthGenerateCommand), undefined) }) it('calls inputOutput with correct config', async () => { - await expect(AppOauthGenerateCommand.run()).resolves.not.toThrow() + await expect(AppOauthGenerateCommand.run([])).resolves.not.toThrow() expect(mockInputOutput).toBeCalledWith( expect.any(AppOauthGenerateCommand), diff --git a/packages/cli/src/__tests__/commands/apps/oauth/update.test.ts b/packages/cli/src/__tests__/commands/apps/oauth/update.test.ts index 87d30297..ccc45e9a 100644 --- a/packages/cli/src/__tests__/commands/apps/oauth/update.test.ts +++ b/packages/cli/src/__tests__/commands/apps/oauth/update.test.ts @@ -30,7 +30,7 @@ describe('AppOauthUpdateCommand', () => { }) it('prompts user to choose app', async () => { - await expect(AppOauthUpdateCommand.run()).resolves.not.toThrow() + await expect(AppOauthUpdateCommand.run([])).resolves.not.toThrow() expect(mockChooseApp).toBeCalledWith(expect.any(AppOauthUpdateCommand), undefined) }) diff --git a/packages/cli/src/__tests__/commands/apps/register.test.ts b/packages/cli/src/__tests__/commands/apps/register.test.ts index 1df80a6c..f8c5d017 100644 --- a/packages/cli/src/__tests__/commands/apps/register.test.ts +++ b/packages/cli/src/__tests__/commands/apps/register.test.ts @@ -37,7 +37,7 @@ describe('AppRegisterCommand', () => { }) it('calls selectFromList with correct config', async () => { - await expect(AppRegisterCommand.run()).resolves.not.toThrow() + await expect(AppRegisterCommand.run([])).resolves.not.toThrow() expect(mockSelectFromList).toBeCalledWith( expect.any(AppRegisterCommand), @@ -76,7 +76,7 @@ describe('AppRegisterCommand', () => { return apps }) - await expect(AppRegisterCommand.run()).resolves.not.toThrow() + await expect(AppRegisterCommand.run([])).resolves.not.toThrow() const listFunction = mockSelectFromList.mock.calls[0][3] await expect(listFunction()).resolves.toEqual(webhookApps.concat(apiOnlyApps)) diff --git a/packages/cli/src/__tests__/commands/apps/settings.test.ts b/packages/cli/src/__tests__/commands/apps/settings.test.ts index af9b6d7a..21b40d54 100644 --- a/packages/cli/src/__tests__/commands/apps/settings.test.ts +++ b/packages/cli/src/__tests__/commands/apps/settings.test.ts @@ -38,7 +38,7 @@ describe('AppSettingsCommand', () => { }) it('prompts user to choose app allowing index', async () => { - await expect(AppSettingsCommand.run()).resolves.not.toThrow() + await expect(AppSettingsCommand.run([])).resolves.not.toThrow() expect(chooseApp).toBeCalledWith( expect.any(AppSettingsCommand), @@ -53,7 +53,7 @@ describe('AppSettingsCommand', () => { return appSettings }) - await expect(AppSettingsCommand.run()).resolves.not.toThrow() + await expect(AppSettingsCommand.run([])).resolves.not.toThrow() expect(outputItem).toBeCalledWith( expect.any(AppSettingsCommand), @@ -76,7 +76,7 @@ describe('AppSettingsCommand', () => { }) mockChooseApp.mockResolvedValueOnce(appId) - await expect(AppSettingsCommand.run()).resolves.not.toThrow() + await expect(AppSettingsCommand.run([])).resolves.not.toThrow() expect(settingsSpy).toBeCalledWith(appId) }) diff --git a/packages/cli/src/__tests__/commands/apps/settings/update.test.ts b/packages/cli/src/__tests__/commands/apps/settings/update.test.ts index 168c0bb6..9f7a1950 100644 --- a/packages/cli/src/__tests__/commands/apps/settings/update.test.ts +++ b/packages/cli/src/__tests__/commands/apps/settings/update.test.ts @@ -30,7 +30,7 @@ describe('AppSettingsUpdateCommand', () => { }) it('prompts user to choose app', async () => { - await expect(AppSettingsUpdateCommand.run()).resolves.not.toThrow() + await expect(AppSettingsUpdateCommand.run([])).resolves.not.toThrow() expect(mockChooseApp).toBeCalledWith(expect.any(AppSettingsUpdateCommand), undefined) }) diff --git a/packages/cli/src/__tests__/commands/apps/update.test.ts b/packages/cli/src/__tests__/commands/apps/update.test.ts index d6b17607..68088a3f 100644 --- a/packages/cli/src/__tests__/commands/apps/update.test.ts +++ b/packages/cli/src/__tests__/commands/apps/update.test.ts @@ -46,7 +46,7 @@ describe('AppUpdateCommand', () => { }) it('prompts user to choose app', async () => { - await expect(AppUpdateCommand.run()).resolves.not.toThrow() + await expect(AppUpdateCommand.run([])).resolves.not.toThrow() expect(chooseApp).toBeCalledWith( expect.any(AppUpdateCommand), @@ -55,7 +55,7 @@ describe('AppUpdateCommand', () => { }) it('calls inputOutput with correct config', async () => { - await expect(AppUpdateCommand.run()).resolves.not.toThrow() + await expect(AppUpdateCommand.run([])).resolves.not.toThrow() expect(mockInputOutput).toBeCalledWith( expect.any(AppUpdateCommand), diff --git a/packages/cli/src/__tests__/commands/devicepreferences/translations.test.ts b/packages/cli/src/__tests__/commands/devicepreferences/translations.test.ts index 3613de16..f8265826 100644 --- a/packages/cli/src/__tests__/commands/devicepreferences/translations.test.ts +++ b/packages/cli/src/__tests__/commands/devicepreferences/translations.test.ts @@ -41,7 +41,7 @@ describe('DevicePreferencesTranslationsCommand', () => { }) it('prompts user to choose device preference', async () => { - await expect(DevicePreferencesTranslationsCommand.run()).resolves.not.toThrow() + await expect(DevicePreferencesTranslationsCommand.run([])).resolves.not.toThrow() expect(chooseDevicePreference).toBeCalledWith( expect.any(DevicePreferencesTranslationsCommand), diff --git a/packages/cli/src/__tests__/commands/devicepreferences/translations/create.test.ts b/packages/cli/src/__tests__/commands/devicepreferences/translations/create.test.ts index d0e51ebe..ba685453 100644 --- a/packages/cli/src/__tests__/commands/devicepreferences/translations/create.test.ts +++ b/packages/cli/src/__tests__/commands/devicepreferences/translations/create.test.ts @@ -38,7 +38,7 @@ describe('DevicePreferencesTranslationsCreateCommand', () => { }) it('prompts user to choose device preference', async () => { - await expect(DevicePreferencesTranslationsCreateCommand.run()).resolves.not.toThrow() + await expect(DevicePreferencesTranslationsCreateCommand.run([])).resolves.not.toThrow() expect(chooseDevicePreference).toBeCalledWith( expect.any(DevicePreferencesTranslationsCreateCommand), @@ -47,7 +47,7 @@ describe('DevicePreferencesTranslationsCreateCommand', () => { }) it('calls inputOutput with correct config', async () => { - await expect(DevicePreferencesTranslationsCreateCommand.run()).resolves.not.toThrow() + await expect(DevicePreferencesTranslationsCreateCommand.run([])).resolves.not.toThrow() expect(mockInputOutput).toBeCalledWith( expect.any(DevicePreferencesTranslationsCreateCommand), @@ -63,7 +63,7 @@ describe('DevicePreferencesTranslationsCreateCommand', () => { return actionFunction(undefined, MOCK_PREFERENCE_L10N) }) - await expect(DevicePreferencesTranslationsCreateCommand.run()).resolves.not.toThrow() + await expect(DevicePreferencesTranslationsCreateCommand.run([])).resolves.not.toThrow() expect(createTranslationsSpy).toBeCalledWith(preferenceId, MOCK_PREFERENCE_L10N) }) diff --git a/packages/cli/src/__tests__/commands/devices.test.ts b/packages/cli/src/__tests__/commands/devices.test.ts index dd00b4ce..dfc330b6 100644 --- a/packages/cli/src/__tests__/commands/devices.test.ts +++ b/packages/cli/src/__tests__/commands/devices.test.ts @@ -21,7 +21,7 @@ describe('devices', () => { const outputListingMock = outputListing as unknown as jest.Mock it('passes undefined for location id when not specified', async () => { - await expect(DevicesCommand.run()).resolves.not.toThrow() + await expect(DevicesCommand.run([])).resolves.not.toThrow() expect(outputListingMock).toHaveBeenCalledTimes(1) expect(outputListingMock.mock.calls[0][2]).toBeUndefined() diff --git a/packages/cli/src/__tests__/commands/locations.test.ts b/packages/cli/src/__tests__/commands/locations.test.ts index 87a12a50..14b88a0d 100644 --- a/packages/cli/src/__tests__/commands/locations.test.ts +++ b/packages/cli/src/__tests__/commands/locations.test.ts @@ -57,7 +57,7 @@ describe('LocationsCommand', () => { }) it('calls outputListing when no id is provided', async () => { - await expect(LocationsCommand.run()).resolves.not.toThrow() + await expect(LocationsCommand.run([])).resolves.not.toThrow() expect(mockListing).toBeCalledTimes(1) expect(mockListing.mock.calls[0][2]).toBeUndefined() @@ -79,7 +79,7 @@ describe('LocationsCommand', () => { const getSpy = jest.spyOn(LocationsEndpoint.prototype, 'get').mockImplementation() - await expect(LocationsCommand.run()).resolves.not.toThrow() + await expect(LocationsCommand.run([])).resolves.not.toThrow() expect(mockListing).toBeCalledWith( expect.any(LocationsCommand), diff --git a/packages/cli/src/__tests__/commands/locations/create.test.ts b/packages/cli/src/__tests__/commands/locations/create.test.ts index 17d62736..ac133004 100644 --- a/packages/cli/src/__tests__/commands/locations/create.test.ts +++ b/packages/cli/src/__tests__/commands/locations/create.test.ts @@ -26,7 +26,7 @@ describe('LocationsCreateCommand', () => { const createSpy = jest.spyOn(LocationsEndpoint.prototype, 'create').mockImplementation() - await expect(LocationsCreateCommand.run()).resolves.not.toThrow() + await expect(LocationsCreateCommand.run([])).resolves.not.toThrow() expect(mockInputOutput).toBeCalledWith( expect.any(LocationsCreateCommand), diff --git a/packages/cli/src/__tests__/commands/locations/delete.test.ts b/packages/cli/src/__tests__/commands/locations/delete.test.ts index 7fe8471b..04ead3e8 100644 --- a/packages/cli/src/__tests__/commands/locations/delete.test.ts +++ b/packages/cli/src/__tests__/commands/locations/delete.test.ts @@ -21,7 +21,7 @@ describe('LocationsDeleteCommand', () => { }) it('prompts user to choose location', async () => { - await expect(LocationsDeleteCommand.run()).resolves.not.toThrow() + await expect(LocationsDeleteCommand.run([])).resolves.not.toThrow() expect(chooseLocation).toBeCalledWith(expect.any(LocationsDeleteCommand), undefined) }) diff --git a/packages/cli/src/__tests__/commands/locations/rooms.test.ts b/packages/cli/src/__tests__/commands/locations/rooms.test.ts index 4d235e26..3242b848 100644 --- a/packages/cli/src/__tests__/commands/locations/rooms.test.ts +++ b/packages/cli/src/__tests__/commands/locations/rooms.test.ts @@ -39,7 +39,7 @@ describe('RoomsCommand', () => { }) it('calls outputListing correctly', async () => { - await expect(RoomsCommand.run()).resolves.not.toThrow() + await expect(RoomsCommand.run([])).resolves.not.toThrow() expect(mockListing).toBeCalledWith( expect.any(RoomsCommand), @@ -64,7 +64,7 @@ describe('RoomsCommand', () => { ] mockGetRoomsByLocation.mockResolvedValueOnce(roomList) - await expect(RoomsCommand.run()).resolves.not.toThrow() + await expect(RoomsCommand.run([])).resolves.not.toThrow() expect(mockGetRoomsByLocation).toBeCalled() diff --git a/packages/cli/src/__tests__/commands/locations/rooms/create.test.ts b/packages/cli/src/__tests__/commands/locations/rooms/create.test.ts index 4e0dcf51..1d6ebbd6 100644 --- a/packages/cli/src/__tests__/commands/locations/rooms/create.test.ts +++ b/packages/cli/src/__tests__/commands/locations/rooms/create.test.ts @@ -43,7 +43,7 @@ describe('RoomsCreateCommand', () => { const room: Room = { name: 'test' } const createSpy = jest.spyOn(RoomsEndpoint.prototype, 'create').mockResolvedValueOnce(room) - await expect(RoomsCreateCommand.run()).resolves.not.toThrow() + await expect(RoomsCreateCommand.run([])).resolves.not.toThrow() expect(mockChooseLocation).toBeCalledWith(expect.any(RoomsCreateCommand), undefined) expect(mockInputOutput).toBeCalledWith( diff --git a/packages/cli/src/__tests__/commands/locations/rooms/delete.test.ts b/packages/cli/src/__tests__/commands/locations/rooms/delete.test.ts index 7a59a121..aa5838de 100644 --- a/packages/cli/src/__tests__/commands/locations/rooms/delete.test.ts +++ b/packages/cli/src/__tests__/commands/locations/rooms/delete.test.ts @@ -20,7 +20,7 @@ describe('RoomsDeleteCommand', () => { it('prompts user to choose room', async () => { mockChooseRoom.mockResolvedValueOnce([uuid(), uuid()]) - await expect(RoomsDeleteCommand.run()).resolves.not.toThrow() + await expect(RoomsDeleteCommand.run([])).resolves.not.toThrow() expect(chooseRoom).toBeCalledWith(expect.any(RoomsDeleteCommand), undefined, undefined) }) @@ -40,7 +40,7 @@ describe('RoomsDeleteCommand', () => { const locationId = uuid() mockChooseRoom.mockResolvedValueOnce([roomId, locationId]) - await expect(RoomsDeleteCommand.run()).resolves.not.toThrow() + await expect(RoomsDeleteCommand.run([])).resolves.not.toThrow() expect(chooseRoom).toBeCalledWith(expect.any(RoomsDeleteCommand), undefined, undefined) expect(deleteSpy).toBeCalledWith(roomId, locationId) diff --git a/packages/cli/src/__tests__/commands/locations/rooms/update.test.ts b/packages/cli/src/__tests__/commands/locations/rooms/update.test.ts index ad883eca..7f72d777 100644 --- a/packages/cli/src/__tests__/commands/locations/rooms/update.test.ts +++ b/packages/cli/src/__tests__/commands/locations/rooms/update.test.ts @@ -32,7 +32,7 @@ describe('RoomsUpdateCommand', () => { it('prompts user to choose room', async () => { mockChooseRoom.mockResolvedValueOnce([uuid(), uuid()]) - await expect(RoomsUpdateCommand.run()).resolves.not.toThrow() + await expect(RoomsUpdateCommand.run([])).resolves.not.toThrow() expect(mockChooseRoom).toBeCalledWith(expect.any(RoomsUpdateCommand), undefined, undefined) }) @@ -59,7 +59,7 @@ describe('RoomsUpdateCommand', () => { const updateSpy = jest.spyOn(RoomsEndpoint.prototype, 'update').mockImplementation() - await expect(RoomsUpdateCommand.run()).resolves.not.toThrow() + await expect(RoomsUpdateCommand.run([])).resolves.not.toThrow() expect(mockChooseRoom).toBeCalledWith(expect.any(RoomsUpdateCommand), undefined, undefined) expect(mockInputOutput).toBeCalledWith( diff --git a/packages/cli/src/__tests__/commands/locations/update.test.ts b/packages/cli/src/__tests__/commands/locations/update.test.ts index 95d5dc5b..26e55dd9 100644 --- a/packages/cli/src/__tests__/commands/locations/update.test.ts +++ b/packages/cli/src/__tests__/commands/locations/update.test.ts @@ -30,7 +30,7 @@ describe('LocationsUpdateCommand', () => { }) it('prompts user to choose location', async () => { - await expect(LocationsUpdateCommand.run()).resolves.not.toThrow() + await expect(LocationsUpdateCommand.run([])).resolves.not.toThrow() expect(chooseLocation).toBeCalledWith(expect.any(LocationsUpdateCommand), undefined) }) diff --git a/packages/cli/src/__tests__/commands/organizations.test.ts b/packages/cli/src/__tests__/commands/organizations.test.ts index a152cf75..8b77afeb 100644 --- a/packages/cli/src/__tests__/commands/organizations.test.ts +++ b/packages/cli/src/__tests__/commands/organizations.test.ts @@ -24,7 +24,7 @@ describe('OrganizationsCommand', () => { }) it('calls outputListing when no id is provided', async () => { - await expect(OrganizationsCommand.run()).resolves.not.toThrow() + await expect(OrganizationsCommand.run([])).resolves.not.toThrow() expect(mockListing).toBeCalledTimes(1) expect(mockListing.mock.calls[0][2]).toBeUndefined() @@ -46,7 +46,7 @@ describe('OrganizationsCommand', () => { const getSpy = jest.spyOn(OrganizationsEndpoint.prototype, 'get').mockImplementation() - await expect(OrganizationsCommand.run()).resolves.not.toThrow() + await expect(OrganizationsCommand.run([])).resolves.not.toThrow() expect(mockListing).toBeCalledWith( expect.any(OrganizationsCommand), diff --git a/packages/cli/src/__tests__/commands/presentation/device-config.test.ts b/packages/cli/src/__tests__/commands/presentation/device-config.test.ts index 3660de2a..1bebb582 100644 --- a/packages/cli/src/__tests__/commands/presentation/device-config.test.ts +++ b/packages/cli/src/__tests__/commands/presentation/device-config.test.ts @@ -17,7 +17,7 @@ describe('DeviceConfigPresentationCommand', () => { }) it('throws error when required arg missing', async () => { - await expect(DeviceConfigPresentationCommand.run()).rejects.toThrow() + await expect(DeviceConfigPresentationCommand.run([])).rejects.toThrow() }) it('outputs item when required arg is provided', async () => {