Skip to content

Commit 0415d33

Browse files
committed
chore: fixed tests
1 parent bdc9c5d commit 0415d33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands/user/index.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getUser } from './actions'
33
import { konsola } from '../../utils'
44
import { session } from '../../session'
55
import chalk from 'chalk'
6+
import { title } from 'node:process'
67

78
vi.mock('./actions', () => ({
89
getUser: vi.fn(),
@@ -40,6 +41,7 @@ vi.mock('../../utils', async () => {
4041
...actualUtils,
4142
konsola: {
4243
ok: vi.fn(),
44+
title: vi.fn(),
4345
error: vi.fn(),
4446
},
4547
handleError: (error: Error, header = false) => {
@@ -82,8 +84,7 @@ describe('userCommand', () => {
8284
}
8385
await userCommand.parseAsync(['node', 'test'])
8486

85-
expect(konsola.error).toHaveBeenCalledWith(new Error(`You are not logged in. Please login first.
86-
`))
87+
expect(konsola.error).toHaveBeenCalledWith(new Error(`You are currently not logged in. Please login first to get your user info.`), false)
8788
})
8889

8990
it('should show an error if the user information cannot be fetched', async () => {

0 commit comments

Comments
 (0)