Skip to content

Commit

Permalink
test: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgentile committed Dec 27, 2024
1 parent 5ee2e57 commit d0a141f
Showing 1 changed file with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ describe('undeployStudioAction', () => {
it('does nothing if there is no user application', async () => {
helpers.getUserApplication.mockResolvedValueOnce(null)

await undeployStudioAction({} as CliCommandArguments<UndeployStudioActionFlags>, mockContext)
await undeployStudioAction(
{
extOptions: {},
} as CliCommandArguments<UndeployStudioActionFlags>,
mockContext,
)

expect(mockContext.output.print).toHaveBeenCalledWith(
'Your project has not been assigned a studio hostname',
Expand All @@ -75,7 +80,12 @@ describe('undeployStudioAction', () => {
true,
) // User confirms

await undeployStudioAction({} as CliCommandArguments<UndeployStudioActionFlags>, mockContext)
await undeployStudioAction(
{
extOptions: {},
} as CliCommandArguments<UndeployStudioActionFlags>,
mockContext,
)

expect(mockContext.prompt.single).toHaveBeenCalledWith({
type: 'confirm',
Expand All @@ -97,7 +107,12 @@ describe('undeployStudioAction', () => {
false,
) // User cancels

await undeployStudioAction({} as CliCommandArguments<UndeployStudioActionFlags>, mockContext)
await undeployStudioAction(
{
extOptions: {},
} as CliCommandArguments<UndeployStudioActionFlags>,
mockContext,
)

expect(mockContext.prompt.single).toHaveBeenCalledWith({
type: 'confirm',
Expand Down Expand Up @@ -142,7 +157,12 @@ describe('undeployStudioAction', () => {
) // User confirms

await expect(
undeployStudioAction({} as CliCommandArguments<UndeployStudioActionFlags>, mockContext),
undeployStudioAction(
{
extOptions: {},
} as CliCommandArguments<UndeployStudioActionFlags>,
mockContext,
),
).rejects.toThrow(errorMessage)

expect(mockContext.output.spinner('').fail).toHaveBeenCalled()
Expand Down

0 comments on commit d0a141f

Please # to comment.